| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef GOOGLE_APIS_GAIA_IDENTITY_PROVIDER_H_ | 5 #ifndef GOOGLE_APIS_GAIA_IDENTITY_PROVIDER_H_ |
| 6 #define GOOGLE_APIS_GAIA_IDENTITY_PROVIDER_H_ | 6 #define GOOGLE_APIS_GAIA_IDENTITY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Requests login to a GAIA account. Implementations can show a login UI, log | 62 // Requests login to a GAIA account. Implementations can show a login UI, log |
| 63 // in automatically if sufficient credentials are available or may ignore the | 63 // in automatically if sufficient credentials are available or may ignore the |
| 64 // request. Returns true if the login request was processed and false if it | 64 // request. Returns true if the login request was processed and false if it |
| 65 // was ignored. | 65 // was ignored. |
| 66 virtual bool RequestLogin() = 0; | 66 virtual bool RequestLogin() = 0; |
| 67 | 67 |
| 68 void AddObserver(Observer* observer); | 68 void AddObserver(Observer* observer); |
| 69 void RemoveObserver(Observer* observer); | 69 void RemoveObserver(Observer* observer); |
| 70 | 70 |
| 71 // OAuth2TokenService::Observer: | 71 // OAuth2TokenService::Observer: |
| 72 virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE; | 72 virtual void OnRefreshTokenAvailable(const std::string& account_id) override; |
| 73 virtual void OnRefreshTokenRevoked(const std::string& account_id) OVERRIDE; | 73 virtual void OnRefreshTokenRevoked(const std::string& account_id) override; |
| 74 virtual void OnRefreshTokensLoaded() OVERRIDE; | 74 virtual void OnRefreshTokensLoaded() override; |
| 75 | 75 |
| 76 protected: | 76 protected: |
| 77 IdentityProvider(); | 77 IdentityProvider(); |
| 78 | 78 |
| 79 // Fires an OnActiveAccountLogin notification. | 79 // Fires an OnActiveAccountLogin notification. |
| 80 void FireOnActiveAccountLogin(); | 80 void FireOnActiveAccountLogin(); |
| 81 | 81 |
| 82 // Fires an OnActiveAccountLogout notification. | 82 // Fires an OnActiveAccountLogout notification. |
| 83 void FireOnActiveAccountLogout(); | 83 void FireOnActiveAccountLogout(); |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 ObserverList<Observer, true> observers_; | 86 ObserverList<Observer, true> observers_; |
| 87 ObserverList<OAuth2TokenService::Observer, true> token_service_observers_; | 87 ObserverList<OAuth2TokenService::Observer, true> token_service_observers_; |
| 88 int token_service_observer_count_; | 88 int token_service_observer_count_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(IdentityProvider); | 90 DISALLOW_COPY_AND_ASSIGN(IdentityProvider); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 #endif // GOOGLE_APIS_GAIA_IDENTITY_PROVIDER_H_ | 93 #endif // GOOGLE_APIS_GAIA_IDENTITY_PROVIDER_H_ |
| OLD | NEW |