Skip to content

Commit

Permalink
Make "All Bookmarks" to be controlled by feature
Browse files Browse the repository at this point in the history
This is used for controlling this feature in field trial, which targets
at M52.

BUG=605614

Review-Url: https://codereview.chromium.org/2199033002
Cr-Commit-Position: refs/heads/master@{#409069}
  • Loading branch information
jollycopper authored and Commit bot committed Aug 1, 2016
1 parent b492b72 commit b8a3ebb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
import android.text.TextUtils;

import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
Expand Down Expand Up @@ -293,8 +292,6 @@ public static void finishActivityOnPhone(Context context) {
* @return Whether "all bookmarks" section is enabled.
*/
static boolean isAllBookmarksViewEnabled() {
String flag = CommandLine.getInstance()
.getSwitchValue(ChromeSwitches.ENABLE_ALL_BOOKMARKS_VIEW, "false");
return flag.equals("true");
return ChromeFeatureList.isEnabled("AllBookmarks");
}
}
10 changes: 1 addition & 9 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,6 @@ const FeatureEntry::Choice kHerbPrototypeChoices[] = {
{IDS_FLAGS_HERB_PROTOTYPE_FLAVOR_ELDERBERRY,
switches::kTabManagementExperimentTypeElderberry, ""},
};

const FeatureEntry::Choice kEnableAllBookmarksViewChoices[] = {
{ IDS_FLAGS_ENABLE_ALL_BOOKMARKS_VIEW_CHOICE_DEFAULT, "", ""},
{ IDS_FLAGS_ENABLE_ALL_BOOKMARKS_VIEW_CHOICE_ENABLED,
switches::kEnableAllBookmarksView, "true" },
{ IDS_FLAGS_ENABLE_ALL_BOOKMARKS_VIEW_CHOICE_DISABLED,
switches::kEnableAllBookmarksView, "false" },
};
#endif // defined(OS_ANDROID)

const FeatureEntry::Choice kEnableUseZoomForDSFChoices[] = {
Expand Down Expand Up @@ -1287,7 +1279,7 @@ const FeatureEntry kFeatureEntries[] = {
#if defined(OS_ANDROID)
{"enable-all-bookmarks-view", IDS_FLAGS_ENABLE_ALL_BOOKMARKS_VIEW_NAME,
IDS_FLAGS_SHOW_ALL_BOOKMARKS_VIEW_DESCRIPTION, kOsAndroid,
MULTI_VALUE_TYPE(kEnableAllBookmarksViewChoices)},
FEATURE_VALUE_TYPE(chrome::android::kAllBookmarksFeature)},
{"enable-accessibility-tab-switcher",
IDS_FLAGS_ACCESSIBILITY_TAB_SWITCHER_NAME,
IDS_FLAGS_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION, kOsAndroid,
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/android/chrome_feature_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&features::kCredentialManagementAPI,
&features::kSimplifiedFullscreenUI,
&features::kWebPayments,
&kAllBookmarksFeature,
&kAndroidPayIntegrationV1,
&kImportantSitesInCBD,
&kNTPFakeOmniboxTextFeature,
Expand All @@ -53,6 +54,9 @@ const base::Feature* kFeaturesExposedToJava[] = {

} // namespace

const base::Feature kAllBookmarksFeature{"AllBookmarks",
base::FEATURE_ENABLED_BY_DEFAULT};

const base::Feature kImportantSitesInCBD{"ImportantSitesInCBD",
base::FEATURE_DISABLED_BY_DEFAULT};

Expand Down
1 change: 1 addition & 0 deletions chrome/browser/android/chrome_feature_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace chrome {
namespace android {

extern const base::Feature kAllBookmarksFeature;
extern const base::Feature kAndroidPayIntegrationV1;
extern const base::Feature kImportantSitesInCBD;
extern const base::Feature kNTPMaterialDesign;
Expand Down
8 changes: 8 additions & 0 deletions testing/variations/fieldtrial_testing_config_android.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"AllBookmarks": [
{
"enable_features": [
"AllBookmarks"
],
"group_name": "Enabled"
}
],
"AndroidSessionNotifications": [
{
"group_name": "Disabled"
Expand Down

0 comments on commit b8a3ebb

Please sign in to comment.