OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/api/identity/identity_signin_flow.h" | 5 #include "chrome/browser/extensions/api/identity/identity_signin_flow.h" |
6 | 6 |
7 #include "chrome/browser/app_mode/app_mode_utils.h" | 7 #include "chrome/browser/app_mode/app_mode_utils.h" |
8 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 8 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 10 #include "chrome/browser/signin/signin_manager.h" |
| 11 #include "chrome/browser/signin/signin_manager_factory.h" |
10 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 12 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
11 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 13 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
12 | 14 |
13 namespace extensions { | 15 namespace extensions { |
14 | 16 |
15 IdentitySigninFlow::IdentitySigninFlow(Delegate* delegate, Profile* profile) | 17 IdentitySigninFlow::IdentitySigninFlow(Delegate* delegate, Profile* profile) |
16 : delegate_(delegate), | 18 : delegate_(delegate), |
17 profile_(profile) { | 19 profile_(profile) { |
18 } | 20 } |
19 | 21 |
(...skipping 16 matching lines...) Expand all Loading... |
36 | 38 |
37 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->AddObserver(this); | 39 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->AddObserver(this); |
38 | 40 |
39 LoginUIService* login_ui_service = | 41 LoginUIService* login_ui_service = |
40 LoginUIServiceFactory::GetForProfile(profile_); | 42 LoginUIServiceFactory::GetForProfile(profile_); |
41 login_ui_service->ShowLoginPopup(); | 43 login_ui_service->ShowLoginPopup(); |
42 } | 44 } |
43 | 45 |
44 void IdentitySigninFlow::OnRefreshTokenAvailable( | 46 void IdentitySigninFlow::OnRefreshTokenAvailable( |
45 const std::string& account_id) { | 47 const std::string& account_id) { |
46 if (ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> | 48 if (SigninManagerFactory::GetForProfile(profile_)-> |
47 GetPrimaryAccountId() == account_id) { | 49 GetAuthenticatedAccountId() == account_id) { |
48 delegate_->SigninSuccess(); | 50 delegate_->SigninSuccess(); |
49 } | 51 } |
50 } | 52 } |
51 | 53 |
52 } // namespace extensions | 54 } // namespace extensions |
OLD | NEW |