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

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

Issue 517713002: [Android] Add enhanced bookmark opt-in flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed an unused function IsUserSignedin Created 6 years, 3 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 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) {
« no previous file with comments | « chrome/browser/bookmarks/enhanced_bookmarks_features.h ('k') | chrome/browser/chrome_browser_main_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698