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

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

Issue 383083009: [Password Manager] Fix crash in reporting sync stats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 6 years, 5 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/password_manager/sync_metrics.cc
diff --git a/chrome/browser/password_manager/sync_metrics.cc b/chrome/browser/password_manager/sync_metrics.cc
index 43520536e3beba225f80f37151a74a8b22b1e95b..4eddf427ccd22db327b2fa421aaee66bd509056d 100644
--- a/chrome/browser/password_manager/sync_metrics.cc
+++ b/chrome/browser/password_manager/sync_metrics.cc
@@ -13,14 +13,7 @@
namespace password_manager_sync_metrics {
-std::string GetPasswordSyncUsername(Profile* profile) {
- ProfileSyncService* sync_service =
- ProfileSyncServiceFactory::GetForProfile(profile);
- if (!sync_service ||
- !sync_service->HasSyncSetupCompleted() ||
- !sync_service->GetActiveDataTypes().Has(syncer::PASSWORDS))
- return "";
-
+std::string GetSyncUsername(Profile* profile) {
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);
if (!signin_manager)
@@ -29,13 +22,13 @@ std::string GetPasswordSyncUsername(Profile* profile) {
return signin_manager->GetAuthenticatedUsername();
}
-bool IsPasswordSyncAccountCredential(Profile* profile,
- const std::string& username,
- const std::string& origin) {
+bool IsSyncAccountCredential(Profile* profile,
+ const std::string& username,
+ const std::string& origin) {
if (origin != GaiaUrls::GetInstance()->gaia_url().GetOrigin().spec())
return false;
- return gaia::AreEmailsSame(username, GetPasswordSyncUsername(profile));
+ return gaia::AreEmailsSame(username, GetSyncUsername(profile));
}
} // namespace password_manager_sync_metrics
« no previous file with comments | « chrome/browser/password_manager/sync_metrics.h ('k') | chrome/browser/ui/passwords/password_manager_presenter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698