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

Unified Diff: chrome/browser/signin/chrome_signin_client.cc

Issue 813133003: New Profile metric for Auth Errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary forward declaration Created 5 years, 11 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/signin/chrome_signin_client.cc
diff --git a/chrome/browser/signin/chrome_signin_client.cc b/chrome/browser/signin/chrome_signin_client.cc
index bae9a04a6af04edbc34bd22ea18a235f89be6a8f..4de27b475a9dcc78bc460ee6fa87de3fee8dcfa2 100644
--- a/chrome/browser/signin/chrome_signin_client.cc
+++ b/chrome/browser/signin/chrome_signin_client.cc
@@ -49,11 +49,16 @@ const char kGoogleAccountsUrl[] = "https://accounts.google.com";
} // namespace
-ChromeSigninClient::ChromeSigninClient(Profile* profile)
- : profile_(profile), signin_host_id_(ChildProcessHost::kInvalidUniqueID) {
+ChromeSigninClient::ChromeSigninClient(
+ Profile* profile, SigninErrorController* signin_error_controller)
+ : profile_(profile),
+ signin_error_controller_(signin_error_controller),
+ signin_host_id_(ChildProcessHost::kInvalidUniqueID) {
+ signin_error_controller_->AddObserver(this);
}
ChromeSigninClient::~ChromeSigninClient() {
+ signin_error_controller_->RemoveObserver(this);
std::set<RenderProcessHost*>::iterator i;
for (i = signin_hosts_observed_.begin(); i != signin_hosts_observed_.end();
++i) {
@@ -232,3 +237,14 @@ void ChromeSigninClient::PostSignedIn(const std::string& account_id,
chrome::SetLocalAuthCredentials(profile_, password);
#endif
}
+
+void ChromeSigninClient::OnErrorChanged() {
+ ProfileInfoCache& cache = g_browser_process->profile_manager()->
+ GetProfileInfoCache();
+ size_t index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
+ if (index == std::string::npos)
+ return;
+
+ cache.SetProfileIsAuthErrorAtIndex(index,
+ signin_error_controller_->HasError());
+}

Powered by Google App Engine
This is Rietveld 408576698