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

Side by Side Diff: chrome/browser/ui/auto_login_prompter.cc

Issue 12502017: signin: pull basic SigninManager functionality into new SigninManagerBase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix override Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/auto_login_prompter.h" 5 #include "chrome/browser/ui/auto_login_prompter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 25 matching lines...) Expand all
36 // In an incognito window, there may not be a profile sync service and/or 36 // In an incognito window, there may not be a profile sync service and/or
37 // signin manager. 37 // signin manager.
38 if (!ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService( 38 if (!ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(
39 profile)) { 39 profile)) {
40 return false; 40 return false;
41 } 41 }
42 42
43 if (!TokenServiceFactory::GetForProfile(profile)->AreCredentialsValid()) 43 if (!TokenServiceFactory::GetForProfile(profile)->AreCredentialsValid())
44 return false; 44 return false;
45 45
46 SigninManager* signin_manager = 46 SigninManagerBase* signin_manager =
47 SigninManagerFactory::GetInstance()->GetForProfile(profile); 47 SigninManagerFactory::GetInstance()->GetForProfile(profile);
48 if (!signin_manager) 48 if (!signin_manager)
49 return false; 49 return false;
50 50
51 *output = signin_manager->GetAuthenticatedUsername(); 51 *output = signin_manager->GetAuthenticatedUsername();
52 return true; 52 return true;
53 } 53 }
54 54
55 } // namespace 55 } // namespace
56 56
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return; 148 return;
149 149
150 InfoBarService* infobar_service = 150 InfoBarService* infobar_service =
151 InfoBarService::FromWebContents(web_contents()); 151 InfoBarService::FromWebContents(web_contents());
152 // |infobar_service| is NULL for WebContents hosted in WebDialog. 152 // |infobar_service| is NULL for WebContents hosted in WebDialog.
153 if (infobar_service) { 153 if (infobar_service) {
154 AutoLoginInfoBarDelegate::Create(infobar_service, params_); 154 AutoLoginInfoBarDelegate::Create(infobar_service, params_);
155 infobar_shown_ = true; 155 infobar_shown_ = true;
156 } 156 }
157 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698