| OLD | NEW |
| 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 "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 const CookieChangedCallback& callback) { | 200 const CookieChangedCallback& callback) { |
| 201 scoped_ptr<SigninClient::CookieChangedCallbackList::Subscription> | 201 scoped_ptr<SigninClient::CookieChangedCallbackList::Subscription> |
| 202 subscription = callbacks_.Add(callback); | 202 subscription = callbacks_.Add(callback); |
| 203 RegisterForCookieChangedNotification(); | 203 RegisterForCookieChangedNotification(); |
| 204 return subscription.Pass(); | 204 return subscription.Pass(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void ChromeSigninClient::GoogleSigninSucceeded(const std::string& username, | 207 void ChromeSigninClient::GoogleSigninSucceeded(const std::string& username, |
| 208 const std::string& password) { | 208 const std::string& password) { |
| 209 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) | 209 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) |
| 210 // Don't store password hash except for users of account consistency features. | 210 // Don't store password hash except for users of new profile management. |
| 211 if (switches::IsNewProfileManagement()) | 211 if (switches::IsNewProfileManagement()) |
| 212 chrome::SetLocalAuthCredentials(profile_, password); | 212 chrome::SetLocalAuthCredentials(profile_, password); |
| 213 #endif | 213 #endif |
| 214 } | 214 } |
| 215 | 215 |
| 216 void ChromeSigninClient::Observe(int type, | 216 void ChromeSigninClient::Observe(int type, |
| 217 const content::NotificationSource& source, | 217 const content::NotificationSource& source, |
| 218 const content::NotificationDetails& details) { | 218 const content::NotificationDetails& details) { |
| 219 switch (type) { | 219 switch (type) { |
| 220 case chrome::NOTIFICATION_COOKIE_CHANGED: { | 220 case chrome::NOTIFICATION_COOKIE_CHANGED: { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 243 if (!callbacks_.empty()) | 243 if (!callbacks_.empty()) |
| 244 return; | 244 return; |
| 245 // Note that it's allowed to call this method multiple times without an | 245 // Note that it's allowed to call this method multiple times without an |
| 246 // intervening call to |RegisterForCookieChangedNotification()|. | 246 // intervening call to |RegisterForCookieChangedNotification()|. |
| 247 content::Source<Profile> source(profile_); | 247 content::Source<Profile> source(profile_); |
| 248 if (!registrar_.IsRegistered( | 248 if (!registrar_.IsRegistered( |
| 249 this, chrome::NOTIFICATION_COOKIE_CHANGED, source)) | 249 this, chrome::NOTIFICATION_COOKIE_CHANGED, source)) |
| 250 return; | 250 return; |
| 251 registrar_.Remove(this, chrome::NOTIFICATION_COOKIE_CHANGED, source); | 251 registrar_.Remove(this, chrome::NOTIFICATION_COOKIE_CHANGED, source); |
| 252 } | 252 } |
| OLD | NEW |