OLD | NEW |
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 24 matching lines...) Expand all Loading... |
35 // In an incognito window, there may not be a profile sync service and/or | 35 // In an incognito window, there may not be a profile sync service and/or |
36 // signin manager. | 36 // signin manager. |
37 if (!ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService( | 37 if (!ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService( |
38 profile)) { | 38 profile)) { |
39 return false; | 39 return false; |
40 } | 40 } |
41 | 41 |
42 if (!TokenServiceFactory::GetForProfile(profile)->AreCredentialsValid()) | 42 if (!TokenServiceFactory::GetForProfile(profile)->AreCredentialsValid()) |
43 return false; | 43 return false; |
44 | 44 |
45 SigninManager* signin_manager = | 45 SigninManagerBase* signin_manager = |
46 SigninManagerFactory::GetInstance()->GetForProfile(profile); | 46 SigninManagerFactory::GetInstance()->GetForProfile(profile); |
47 if (!signin_manager) | 47 if (!signin_manager) |
48 return false; | 48 return false; |
49 | 49 |
50 *output = signin_manager->GetAuthenticatedUsername(); | 50 *output = signin_manager->GetAuthenticatedUsername(); |
51 return true; | 51 return true; |
52 } | 52 } |
53 | 53 |
54 } // namespace | 54 } // namespace |
55 | 55 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 return; | 147 return; |
148 | 148 |
149 InfoBarService* infobar_service = | 149 InfoBarService* infobar_service = |
150 InfoBarService::FromWebContents(web_contents()); | 150 InfoBarService::FromWebContents(web_contents()); |
151 // |infobar_service| is NULL for WebContents hosted in WebDialog. | 151 // |infobar_service| is NULL for WebContents hosted in WebDialog. |
152 if (infobar_service) { | 152 if (infobar_service) { |
153 AutoLoginInfoBarDelegate::Create(infobar_service, params_); | 153 AutoLoginInfoBarDelegate::Create(infobar_service, params_); |
154 infobar_shown_ = true; | 154 infobar_shown_ = true; |
155 } | 155 } |
156 } | 156 } |
OLD | NEW |