[Media Router] Add integration tests and e2e tests for media router and presentation...
[chromium-blink-merge.git] / chrome / browser / signin / profile_identity_provider.h
blobaa1b1688ede9014bffb44447c77415d9ce880b08
1 // Copyright 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.
5 #ifndef CHROME_BROWSER_SIGNIN_PROFILE_IDENTITY_PROVIDER_H_
6 #define CHROME_BROWSER_SIGNIN_PROFILE_IDENTITY_PROVIDER_H_
8 #include "base/macros.h"
9 #include "components/signin/core/browser/signin_manager_base.h"
10 #include "google_apis/gaia/identity_provider.h"
12 class LoginUIService;
13 class ProfileOAuth2TokenService;
15 // An identity provider implementation that's backed by
16 // ProfileOAuth2TokenService and SigninManager.
17 class ProfileIdentityProvider : public IdentityProvider,
18 public SigninManagerBase::Observer {
19 public:
20 ProfileIdentityProvider(SigninManagerBase* signin_manager,
21 ProfileOAuth2TokenService* token_service,
22 LoginUIService* login_ui_service);
23 ~ProfileIdentityProvider() override;
25 // IdentityProvider:
26 std::string GetActiveUsername() override;
27 std::string GetActiveAccountId() override;
28 OAuth2TokenService* GetTokenService() override;
29 bool RequestLogin() override;
31 // SigninManagerBase::Observer:
32 void GoogleSigninSucceeded(const std::string& account_id,
33 const std::string& username,
34 const std::string& password) override;
35 void GoogleSignedOut(const std::string& account_id,
36 const std::string& username) override;
38 private:
39 SigninManagerBase* const signin_manager_;
40 ProfileOAuth2TokenService* const token_service_;
41 LoginUIService* const login_ui_service_;
43 DISALLOW_COPY_AND_ASSIGN(ProfileIdentityProvider);
46 #endif // CHROME_BROWSER_SIGNIN_PROFILE_IDENTITY_PROVIDER_H_