Chromium Code Reviews| Index: chrome/browser/invalidation/profile_invalidation_auth_provider.cc |
| diff --git a/chrome/browser/invalidation/profile_invalidation_auth_provider.cc b/chrome/browser/invalidation/profile_invalidation_auth_provider.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8e743098fd73f8f0980c7ae9fa8fe72f5723fd84 |
| --- /dev/null |
| +++ b/chrome/browser/invalidation/profile_invalidation_auth_provider.cc |
| @@ -0,0 +1,49 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/invalidation/profile_invalidation_auth_provider.h" |
| + |
| +#include "chrome/browser/chrome_notification_types.h" |
| +#include "chrome/browser/profiles/profile.h" |
|
pavely
2014/03/07 23:43:29
I think you don't need chrome_notification_types.h
Mattias Nissler (ping if slow)
2014/03/08 01:30:07
Done.
|
| +#include "chrome/browser/signin/profile_oauth2_token_service.h" |
| +#include "chrome/browser/signin/signin_manager_base.h" |
| +#include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| +#include "content/public/browser/notification_service.h" |
| + |
| +namespace invalidation { |
| + |
| +ProfileInvalidationAuthProvider::ProfileInvalidationAuthProvider( |
| + SigninManagerBase* signin_manager, |
| + ProfileOAuth2TokenService* token_service, |
| + LoginUIService* login_ui_service) |
| + : signin_manager_(signin_manager), |
| + token_service_(token_service), |
| + login_ui_service_(login_ui_service) { |
| + signin_manager_->AddObserver(this); |
| +} |
| + |
| +ProfileInvalidationAuthProvider:: |
| + ~ProfileInvalidationAuthProvider() { |
| + signin_manager_->RemoveObserver(this); |
| +} |
| + |
| +std::string ProfileInvalidationAuthProvider::GetAccountId() { |
| + return signin_manager_->GetAuthenticatedAccountId(); |
| +} |
| + |
| +OAuth2TokenService* ProfileInvalidationAuthProvider::GetTokenService() { |
| + return token_service_; |
| +} |
| + |
| +bool ProfileInvalidationAuthProvider::ShowLoginUI() { |
| + login_ui_service_->ShowLoginPopup(); |
| + return true; |
| +} |
| + |
| +void ProfileInvalidationAuthProvider::GoogleSignedOut( |
| + const std::string& username) { |
| + FireInvalidationAuthLogout(); |
| +} |
| + |
| +} // namespace invalidation |