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

Side by Side Diff: chrome/browser/signin/chrome_signin_client.cc

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 6 years 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 "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/content_settings/cookie_settings.h" 12 #include "chrome/browser/content_settings/cookie_settings.h"
12 #include "chrome/browser/net/chrome_cookie_notification_details.h" 13 #include "chrome/browser/net/chrome_cookie_notification_details.h"
13 #include "chrome/browser/profiles/profile_info_cache.h" 14 #include "chrome/browser/profiles/profile_info_cache.h"
14 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/browser/profiles/profile_metrics.h"
15 #include "chrome/browser/signin/local_auth.h" 17 #include "chrome/browser/signin/local_auth.h"
16 #include "chrome/browser/signin/signin_cookie_changed_subscription.h" 18 #include "chrome/browser/signin/signin_cookie_changed_subscription.h"
17 #include "chrome/browser/webdata/web_data_service_factory.h" 19 #include "chrome/browser/webdata/web_data_service_factory.h"
18 #include "chrome/common/chrome_version_info.h" 20 #include "chrome/common/chrome_version_info.h"
19 #include "components/metrics/metrics_service.h" 21 #include "components/metrics/metrics_service.h"
20 #include "components/signin/core/common/profile_management_switches.h" 22 #include "components/signin/core/common/profile_management_switches.h"
21 #include "components/signin/core/common/signin_pref_names.h" 23 #include "components/signin/core/common/signin_pref_names.h"
22 #include "components/signin/core/common/signin_switches.h" 24 #include "components/signin/core/common/signin_switches.h"
23 #include "content/public/browser/render_process_host.h" 25 #include "content/public/browser/render_process_host.h"
24 #include "content/public/common/child_process_host.h" 26 #include "content/public/common/child_process_host.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 210 }
209 211
210 void ChromeSigninClient::GoogleSigninSucceeded(const std::string& account_id, 212 void ChromeSigninClient::GoogleSigninSucceeded(const std::string& account_id,
211 const std::string& username, 213 const std::string& username,
212 const std::string& password) { 214 const std::string& password) {
213 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) 215 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS)
214 // Don't store password hash except for users of new profile management. 216 // Don't store password hash except for users of new profile management.
215 if (switches::IsNewProfileManagement() && !password.empty()) 217 if (switches::IsNewProfileManagement() && !password.empty())
216 chrome::SetLocalAuthCredentials(profile_, password); 218 chrome::SetLocalAuthCredentials(profile_, password);
217 #endif 219 #endif
220
221 ProfileManager* profile_manager = g_browser_process->profile_manager();
222 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
223 size_t index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
224 if (index != std::string::npos) {
225 cache.SetUserNameOfProfileAtIndex(index, base::UTF8ToUTF16(username));
226 ProfileMetrics::UpdateReportedProfilesStatistics(profile_manager);
227 }
218 } 228 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_manager.cc ('k') | chrome/browser/signin/signin_global_error_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698