| 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/ui/webui/signin/login_ui_service.h" | 10 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->AddObserver(this); | 37 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->AddObserver(this); |
| 38 | 38 |
| 39 LoginUIService* login_ui_service = | 39 LoginUIService* login_ui_service = |
| 40 LoginUIServiceFactory::GetForProfile(profile_); | 40 LoginUIServiceFactory::GetForProfile(profile_); |
| 41 login_ui_service->ShowLoginPopup(); | 41 login_ui_service->ShowLoginPopup(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void IdentitySigninFlow::OnRefreshTokenAvailable( | 44 void IdentitySigninFlow::OnRefreshTokenAvailable( |
| 45 const std::string& account_id) { | 45 const std::string& account_id) { |
| 46 delegate_->SigninSuccess(); | 46 if (ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> |
| 47 GetPrimaryAccountId() == account_id) { |
| 48 delegate_->SigninSuccess(); |
| 49 } |
| 47 } | 50 } |
| 48 | 51 |
| 49 } // namespace extensions | 52 } // namespace extensions |
| OLD | NEW |