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 aad3817e1bcacbf3786729c87ccb50b76c88132b..8103d24b3fcb6f3759c0f469813bfe2c15811386 100644 |
--- a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc |
+++ b/chrome/browser/bookmarks/enhanced_bookmarks_features.cc |
@@ -129,6 +129,14 @@ void UpdateBookmarksExperimentState( |
} |
} |
+#if defined(OS_ANDROID) |
+ bool opt_in = !opt_out |
+ && CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
+ switches::kEnhancedBookmarksExperiment) == "1"; |
+ if (opt_in && bookmarks_experiment_new_state == BOOKMARKS_EXPERIMENT_NONE) |
+ bookmarks_experiment_new_state = BOOKMARKS_EXPERIMENT_ENABLED; |
+#endif |
+ |
UMA_HISTOGRAM_ENUMERATION("EnhancedBookmarks.SyncExperimentState", |
bookmarks_experiment_new_state, |
BOOKMARKS_EXPERIMENT_ENUM_SIZE); |
@@ -168,19 +176,10 @@ void ForceFinchBookmarkExperimentIfNeeded( |
} |
} |
-bool IsEnhancedBookmarksExperimentEnabled() { |
- CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- if (command_line->HasSwitch(switches::kManualEnhancedBookmarks) || |
- command_line->HasSwitch(switches::kManualEnhancedBookmarksOptout)) { |
- return true; |
- } |
- |
- return IsEnhancedBookmarksExperimentEnabledFromFinch(); |
-} |
- |
#if defined(OS_ANDROID) |
-bool IsEnhancedBookmarkImageFetchingEnabled() { |
- if (IsEnhancedBookmarksExperimentEnabled()) |
+ |
+bool IsEnhancedBookmarkImageFetchingEnabled(const PrefService* user_prefs) { |
+ if (IsEnhancedBookmarksExperimentEnabled(user_prefs)) |
return true; |
// Salient images are collected from visited bookmarked pages even if the |
@@ -192,6 +191,27 @@ bool IsEnhancedBookmarkImageFetchingEnabled() { |
kFieldTrialName, "DisableImagesFetching"); |
return disable_fetching.empty(); |
} |
+ |
+bool IsEnhancedBookmarksExperimentEnabled(const PrefService* user_prefs) { |
+ BookmarksExperimentState bookmarks_experiment_state = |
+ static_cast<BookmarksExperimentState>(user_prefs->GetInteger( |
+ sync_driver::prefs::kEnhancedBookmarksExperimentEnabled)); |
+ return bookmarks_experiment_state == BOOKMARKS_EXPERIMENT_ENABLED |
Yaron
2014/08/27 20:42:15
Why can't you use the switches variant? Isn't that
Kibeom Kim (inactive)
2014/08/27 21:11:41
I see.
I was following the logic here https://chr
|
+ || bookmarks_experiment_state == BOOKMARKS_EXPERIMENT_ENABLED_FROM_FINCH; |
+} |
+ |
+#else |
+ |
+bool IsEnhancedBookmarksExperimentEnabled() { |
+ CommandLine* command_line = CommandLine::ForCurrentProcess(); |
+ if (command_line->HasSwitch(switches::kManualEnhancedBookmarks) || |
+ command_line->HasSwitch(switches::kManualEnhancedBookmarksOptout)) { |
+ return true; |
+ } |
+ |
+ return IsEnhancedBookmarksExperimentEnabledFromFinch(); |
+} |
+ |
#endif |
bool IsEnableDomDistillerSet() { |