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

Side by Side 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: Headers cleanup 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/signin/chrome_signin_client.h" 5 #include "chrome/browser/signin/chrome_signin_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/content_settings/cookie_settings.h" 12 #include "chrome/browser/content_settings/cookie_settings.h"
13 #include "chrome/browser/net/chrome_cookie_notification_details.h" 13 #include "chrome/browser/net/chrome_cookie_notification_details.h"
14 #include "chrome/browser/profiles/profile_info_cache.h" 14 #include "chrome/browser/profiles/profile_info_cache.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/browser/profiles/profile_metrics.h" 16 #include "chrome/browser/profiles/profile_metrics.h"
17 #include "chrome/browser/profiles/profile_window.h" 17 #include "chrome/browser/profiles/profile_window.h"
18 #include "chrome/browser/signin/local_auth.h" 18 #include "chrome/browser/signin/local_auth.h"
19 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
19 #include "chrome/browser/signin/signin_cookie_changed_subscription.h" 20 #include "chrome/browser/signin/signin_cookie_changed_subscription.h"
20 #include "chrome/browser/webdata/web_data_service_factory.h" 21 #include "chrome/browser/webdata/web_data_service_factory.h"
21 #include "chrome/common/chrome_version_info.h" 22 #include "chrome/common/chrome_version_info.h"
22 #include "components/metrics/metrics_service.h" 23 #include "components/metrics/metrics_service.h"
24 #include "components/signin/core/browser/profile_oauth2_token_service.h"
23 #include "components/signin/core/common/profile_management_switches.h" 25 #include "components/signin/core/common/profile_management_switches.h"
24 #include "components/signin/core/common/signin_pref_names.h" 26 #include "components/signin/core/common/signin_pref_names.h"
25 #include "components/signin/core/common/signin_switches.h" 27 #include "components/signin/core/common/signin_switches.h"
26 #include "content/public/browser/render_process_host.h" 28 #include "content/public/browser/render_process_host.h"
27 #include "content/public/common/child_process_host.h" 29 #include "content/public/common/child_process_host.h"
28 #include "net/url_request/url_request_context_getter.h" 30 #include "net/url_request/url_request_context_getter.h"
29 #include "url/gurl.h" 31 #include "url/gurl.h"
30 32
31 #if defined(ENABLE_SUPERVISED_USERS) 33 #if defined(ENABLE_SUPERVISED_USERS)
32 #include "chrome/browser/supervised_user/supervised_user_constants.h" 34 #include "chrome/browser/supervised_user/supervised_user_constants.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 227
226 void ChromeSigninClient::PostSignedIn(const std::string& account_id, 228 void ChromeSigninClient::PostSignedIn(const std::string& account_id,
227 const std::string& username, 229 const std::string& username,
228 const std::string& password) { 230 const std::string& password) {
229 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) 231 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS)
230 // Don't store password hash except when lock is available for the user. 232 // Don't store password hash except when lock is available for the user.
231 if (!password.empty() && profiles::IsLockAvailable(profile_)) 233 if (!password.empty() && profiles::IsLockAvailable(profile_))
232 chrome::SetLocalAuthCredentials(profile_, password); 234 chrome::SetLocalAuthCredentials(profile_, password);
233 #endif 235 #endif
234 } 236 }
237
238 void ChromeSigninClient::OnErrorChanged() {
239 ProfileInfoCache& cache = g_browser_process->profile_manager()->
240 GetProfileInfoCache();
241 size_t index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
242 if (index != std::string::npos) {
noms (inactive) 2015/01/08 21:49:04 nit: change to if (index==std::string::npos) r
Mike Lerman 2015/01/09 02:15:04 I don't really like it... but Done.
243 cache.SetProfileIsAuthErrorAtIndex(index,
244 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->
245 signin_error_controller()->HasError());
246 }
247 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698