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

Unified Diff: components/password_manager/core/browser/password_bubble_experiment.cc

Issue 2049503004: Add a "not signed in" condition to the Sync promo in the password bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: components/password_manager/core/browser/password_bubble_experiment.cc
diff --git a/components/password_manager/core/browser/password_bubble_experiment.cc b/components/password_manager/core/browser/password_bubble_experiment.cc
index 1001bf3b4e2d6fccc2408873a2cac246710cb6f9..9b41bde9c2a5ce0eaab51d57f3e493217dbbf8ac 100644
--- a/components/password_manager/core/browser/password_bubble_experiment.cc
+++ b/components/password_manager/core/browser/password_bubble_experiment.cc
@@ -13,6 +13,7 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
+#include "components/sync_driver/sync_service.h"
#include "components/variations/variations_associated_data.h"
namespace password_bubble_experiment {
@@ -102,11 +103,16 @@ void TurnOffAutoSignin(PrefService* prefs) {
false);
}
-bool ShouldShowChromeSignInPasswordPromo(PrefService* prefs) {
+bool ShouldShowChromeSignInPasswordPromo(
+ PrefService* prefs,
+ const sync_driver::SyncService* sync_service) {
// Query the group first for correct UMA reporting.
std::string param = variations::GetVariationParamValue(
kChromeSignInPasswordPromoExperimentName,
kChromeSignInPasswordPromoThresholdParam);
+ if (!sync_service || !sync_service->IsSyncAllowed() ||
+ sync_service->IsFirstSetupComplete())
+ return false;
int threshold = 0;
return base::StringToInt(param, &threshold) &&
!prefs->GetBoolean(

Powered by Google App Engine
This is Rietveld 408576698