| 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 6f4b36b25ef47361c5f24a787bc46c1a46f3b9f2..b1237632f05d229e4bc389538d8a10350607f98e 100644
|
| --- a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc
|
| +++ b/chrome/browser/bookmarks/enhanced_bookmarks_features.cc
|
| @@ -10,8 +10,12 @@
|
| #include "base/prefs/scoped_user_pref_update.h"
|
| #include "base/sha1.h"
|
| #include "base/strings/string_number_conversions.h"
|
| +#include "chrome/browser/browser_process.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/signin/signin_manager_factory.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/pref_names.h"
|
| +#include "components/signin/core/browser/signin_manager.h"
|
| #include "components/sync_driver/pref_names.h"
|
| #include "components/variations/variations_associated_data.h"
|
| #include "extensions/common/features/feature.h"
|
| @@ -129,6 +133,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);
|
| @@ -139,6 +151,16 @@ void UpdateBookmarksExperimentState(
|
| bookmarks_experiment_new_state);
|
| }
|
|
|
| +void InitBookmarksExperimentState(Profile* profile) {
|
| + SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile);
|
| + bool is_signed_in = signin && !signin->IsAuthenticated();
|
| + UpdateBookmarksExperimentState(
|
| + profile->GetPrefs(),
|
| + g_browser_process->local_state(),
|
| + is_signed_in,
|
| + BOOKMARKS_EXPERIMENT_ENABLED_FROM_SYNC_UNKNOWN);
|
| +}
|
| +
|
| void ForceFinchBookmarkExperimentIfNeeded(
|
| PrefService* flags_storage,
|
| BookmarksExperimentState bookmarks_experiment_state) {
|
|
|