Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6023)

Unified Diff: chrome/browser/bookmarks/enhanced_bookmarks_features.cc

Issue 1017913002: Force Enhanced Bookmark to be enabled if command line flags are set true (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Did a further refactoring and created a universal isEnhancedBookmarkEnabled method Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/bookmarks/enhanced_bookmarks_features.cc
diff --git a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc b/chrome/browser/bookmarks/enhanced_bookmarks_features.cc
index 9f681c6b38764215cc496431cb9dfae13fd0139f..c8160809f61871fe21f80722f20a2d263d781c15 100644
--- a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc
+++ b/chrome/browser/bookmarks/enhanced_bookmarks_features.cc
@@ -37,17 +37,8 @@ bool GetBookmarksExperimentExtensionID(std::string* extension_id) {
if (extension_id->empty())
return false;
- // kEnhancedBookmarksExperiment flag could have values "", "1" and "0".
- // "0" - user opted out.
- bool opt_out = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kEnhancedBookmarksExperiment) == "0";
-
- if (opt_out)
- return false;
-
#if defined(OS_ANDROID)
- return base::android::BuildInfo::GetInstance()->sdk_int() >
- base::android::SdkVersion::SDK_VERSION_ICE_CREAM_SANDWICH_MR1;
+ return true;
#else
const extensions::FeatureProvider* feature_provider =
extensions::FeatureProvider::GetPermissionFeatures();
@@ -73,10 +64,33 @@ bool IsEnhancedBookmarkImageFetchingEnabled(const PrefService* user_prefs) {
bool IsEnhancedBookmarksEnabled() {
std::string extension_id;
- return GetBookmarksExperimentExtensionID(&extension_id);
+ return IsEnhancedBookmarksEnabled(&extension_id);
}
#endif
+bool IsEnhancedBookmarksEnabled(std::string* extension_id) {
+ // kEnhancedBookmarksExperiment flag could have values "", "1" and "0".
+ // "0" - user opted out.
+ bool opt_out = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kEnhancedBookmarksExperiment) == "0";
+
+#if defined(OS_ANDROID)
+ opt_out |= base::android::BuildInfo::GetInstance()->sdk_int() <
+ base::android::SdkVersion::SDK_VERSION_ICE_CREAM_SANDWICH_MR1;
+
+ // Android tests use command line flag to force enhanced bookmark to be on.
+ bool opt_in = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kEnhancedBookmarksExperiment) == "1";
+ if (opt_in)
+ return true;
+#endif
+
+ if (opt_out)
+ return false;
+
+ return GetBookmarksExperimentExtensionID(extension_id);
+}
+
bool IsEnableDomDistillerSet() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableDomDistiller)) {

Powered by Google App Engine
This is Rietveld 408576698