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

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

Issue 475533006: Store local auth credentials iff needed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 ChromeSigninClient::AddCookieChangedCallback( 180 ChromeSigninClient::AddCookieChangedCallback(
181 const CookieChangedCallback& callback) { 181 const CookieChangedCallback& callback) {
182 scoped_ptr<SigninClient::CookieChangedCallbackList::Subscription> 182 scoped_ptr<SigninClient::CookieChangedCallbackList::Subscription>
183 subscription = callbacks_.Add(callback); 183 subscription = callbacks_.Add(callback);
184 RegisterForCookieChangedNotification(); 184 RegisterForCookieChangedNotification();
185 return subscription.Pass(); 185 return subscription.Pass();
186 } 186 }
187 187
188 void ChromeSigninClient::GoogleSigninSucceeded(const std::string& username, 188 void ChromeSigninClient::GoogleSigninSucceeded(const std::string& username,
189 const std::string& password) { 189 const std::string& password) {
190 #if !defined(OS_ANDROID) 190 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS)
191 // Don't store password hash except for users of account consistency features. 191 // Don't store password hash except for users of account consistency features.
192 if (switches::IsEnableAccountConsistency()) 192 if (switches::IsNewProfileManagement())
193 chrome::SetLocalAuthCredentials(profile_, password); 193 chrome::SetLocalAuthCredentials(profile_, password);
194 #endif 194 #endif
195 } 195 }
196 196
197 void ChromeSigninClient::Observe(int type, 197 void ChromeSigninClient::Observe(int type,
198 const content::NotificationSource& source, 198 const content::NotificationSource& source,
199 const content::NotificationDetails& details) { 199 const content::NotificationDetails& details) {
200 switch (type) { 200 switch (type) {
201 case chrome::NOTIFICATION_COOKIE_CHANGED: { 201 case chrome::NOTIFICATION_COOKIE_CHANGED: {
202 DCHECK(!callbacks_.empty()); 202 DCHECK(!callbacks_.empty());
(...skipping 21 matching lines...) Expand all
224 if (!callbacks_.empty()) 224 if (!callbacks_.empty())
225 return; 225 return;
226 // Note that it's allowed to call this method multiple times without an 226 // Note that it's allowed to call this method multiple times without an
227 // intervening call to |RegisterForCookieChangedNotification()|. 227 // intervening call to |RegisterForCookieChangedNotification()|.
228 content::Source<Profile> source(profile_); 228 content::Source<Profile> source(profile_);
229 if (!registrar_.IsRegistered( 229 if (!registrar_.IsRegistered(
230 this, chrome::NOTIFICATION_COOKIE_CHANGED, source)) 230 this, chrome::NOTIFICATION_COOKIE_CHANGED, source))
231 return; 231 return;
232 registrar_.Remove(this, chrome::NOTIFICATION_COOKIE_CHANGED, source); 232 registrar_.Remove(this, chrome::NOTIFICATION_COOKIE_CHANGED, source);
233 } 233 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698