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

Unified Diff: chrome/browser/password_manager/password_manager_setting_migrator_service.cc

Issue 1373983005: [Smart Lock, Settings Reconciliation] Histograms for tracking initial and final pref values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on top of master. Created 5 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
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_manager_setting_migrator_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_manager_setting_migrator_service.cc
diff --git a/chrome/browser/password_manager/password_manager_setting_migrator_service.cc b/chrome/browser/password_manager/password_manager_setting_migrator_service.cc
index 10797ec18bcdf6fd253d39ba59f01c23ba6d9d3a..7aa4717cc02d17f8cc0036d9c2e5a3d48e0c6c39 100644
--- a/chrome/browser/password_manager/password_manager_setting_migrator_service.cc
+++ b/chrome/browser/password_manager/password_manager_setting_migrator_service.cc
@@ -61,6 +61,32 @@ void SaveCurrentPrefState(PrefService* prefs,
prefs, password_manager::prefs::kPasswordManagerSavingEnabled);
}
+void TrackInitialAndFinalValues(PrefService* prefs,
+ bool initial_new_pref_value,
+ bool initial_legacy_pref_value) {
+ bool final_new_pref_value =
+ prefs->GetBoolean(password_manager::prefs::kCredentialsEnableService);
+ bool final_legacy_pref_value =
+ prefs->GetBoolean(password_manager::prefs::kPasswordManagerSavingEnabled);
+ const int kMaxInitValue = 0x10;
+ int value_to_log = 0;
+ const int kInitialNewValueMask = 0x8;
+ const int kInitialLegacyValueMask = 0x4;
+ const int kFinalNewValueMask = 0x2;
+ const int kFinalLegacyValueMask = 0x1;
+ if (initial_new_pref_value)
+ value_to_log |= kInitialNewValueMask;
+ if (initial_legacy_pref_value)
+ value_to_log |= kInitialLegacyValueMask;
+ if (final_new_pref_value)
+ value_to_log |= kFinalNewValueMask;
+ if (final_legacy_pref_value)
+ value_to_log |= kFinalLegacyValueMask;
+ UMA_HISTOGRAM_ENUMERATION(
+ "PasswordManager.SettingsReconciliation.InitialAndFinalValues",
+ value_to_log, kMaxInitValue);
+}
+
} // namespace
// static
@@ -132,8 +158,11 @@ void PasswordManagerSettingMigratorService::Observe(
}
if (ProfileSyncServiceFactory::HasProfileSyncService(profile_))
sync_service_ = ProfileSyncServiceFactory::GetForProfile(profile_);
- if (!CanSyncStart())
+ if (!CanSyncStart()) {
MigrateOffState(profile_->GetPrefs());
+ TrackInitialAndFinalValues(profile_->GetPrefs(), initial_new_pref_value_,
+ initial_legacy_pref_value_);
+ }
InitObservers();
}
@@ -235,6 +264,6 @@ void PasswordManagerSettingMigratorService::MigrateAfterModelAssociation(
UpdatePreferencesValues(prefs, false);
}
}
- // TODO(melandory) Add histogram which will log combination of initial and
- // final values for the both preferences.
+ TrackInitialAndFinalValues(prefs, initial_new_pref_value_,
+ initial_legacy_pref_value_);
}
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_manager_setting_migrator_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698