OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/invalidation/profile_invalidation_auth_provider.h" |
| 6 |
| 7 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 8 #include "components/signin/core/profile_oauth2_token_service.h" |
| 9 |
| 10 namespace invalidation { |
| 11 |
| 12 ProfileInvalidationAuthProvider::ProfileInvalidationAuthProvider( |
| 13 SigninManagerBase* signin_manager, |
| 14 ProfileOAuth2TokenService* token_service, |
| 15 LoginUIService* login_ui_service) |
| 16 : signin_manager_(signin_manager), |
| 17 token_service_(token_service), |
| 18 login_ui_service_(login_ui_service) { |
| 19 signin_manager_->AddObserver(this); |
| 20 } |
| 21 |
| 22 ProfileInvalidationAuthProvider::~ProfileInvalidationAuthProvider() { |
| 23 signin_manager_->RemoveObserver(this); |
| 24 } |
| 25 |
| 26 std::string ProfileInvalidationAuthProvider::GetAccountId() { |
| 27 return signin_manager_->GetAuthenticatedAccountId(); |
| 28 } |
| 29 |
| 30 OAuth2TokenService* ProfileInvalidationAuthProvider::GetTokenService() { |
| 31 return token_service_; |
| 32 } |
| 33 |
| 34 bool ProfileInvalidationAuthProvider::ShowLoginUI() { |
| 35 login_ui_service_->ShowLoginPopup(); |
| 36 return true; |
| 37 } |
| 38 |
| 39 void ProfileInvalidationAuthProvider::GoogleSignedOut( |
| 40 const std::string& username) { |
| 41 FireInvalidationAuthLogout(); |
| 42 } |
| 43 |
| 44 } // namespace invalidation |
OLD | NEW |