| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DRIVE_AUTH_SERVICE_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_AUTH_SERVICE_H_ |
| 6 #define GOOGLE_APIS_DRIVE_AUTH_SERVICE_H_ | 6 #define GOOGLE_APIS_DRIVE_AUTH_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // URLFetcher. | 33 // URLFetcher. |
| 34 // | 34 // |
| 35 // |scopes| specifies OAuth2 scopes. | 35 // |scopes| specifies OAuth2 scopes. |
| 36 AuthService(OAuth2TokenService* oauth2_token_service, | 36 AuthService(OAuth2TokenService* oauth2_token_service, |
| 37 const std::string& account_id, | 37 const std::string& account_id, |
| 38 net::URLRequestContextGetter* url_request_context_getter, | 38 net::URLRequestContextGetter* url_request_context_getter, |
| 39 const std::vector<std::string>& scopes); | 39 const std::vector<std::string>& scopes); |
| 40 virtual ~AuthService(); | 40 virtual ~AuthService(); |
| 41 | 41 |
| 42 // Overriden from AuthServiceInterface: | 42 // Overriden from AuthServiceInterface: |
| 43 virtual void AddObserver(AuthServiceObserver* observer) OVERRIDE; | 43 virtual void AddObserver(AuthServiceObserver* observer) override; |
| 44 virtual void RemoveObserver(AuthServiceObserver* observer) OVERRIDE; | 44 virtual void RemoveObserver(AuthServiceObserver* observer) override; |
| 45 virtual void StartAuthentication(const AuthStatusCallback& callback) OVERRIDE; | 45 virtual void StartAuthentication(const AuthStatusCallback& callback) override; |
| 46 virtual bool HasAccessToken() const OVERRIDE; | 46 virtual bool HasAccessToken() const override; |
| 47 virtual bool HasRefreshToken() const OVERRIDE; | 47 virtual bool HasRefreshToken() const override; |
| 48 virtual const std::string& access_token() const OVERRIDE; | 48 virtual const std::string& access_token() const override; |
| 49 virtual void ClearAccessToken() OVERRIDE; | 49 virtual void ClearAccessToken() override; |
| 50 virtual void ClearRefreshToken() OVERRIDE; | 50 virtual void ClearRefreshToken() override; |
| 51 | 51 |
| 52 // Overridden from OAuth2TokenService::Observer: | 52 // Overridden from OAuth2TokenService::Observer: |
| 53 virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE; | 53 virtual void OnRefreshTokenAvailable(const std::string& account_id) override; |
| 54 virtual void OnRefreshTokenRevoked(const std::string& account_id) OVERRIDE; | 54 virtual void OnRefreshTokenRevoked(const std::string& account_id) override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // Called when the state of the refresh token changes. | 57 // Called when the state of the refresh token changes. |
| 58 void OnHandleRefreshToken(bool has_refresh_token); | 58 void OnHandleRefreshToken(bool has_refresh_token); |
| 59 | 59 |
| 60 // Called when authentication request from StartAuthentication() is | 60 // Called when authentication request from StartAuthentication() is |
| 61 // completed. | 61 // completed. |
| 62 void OnAuthCompleted(const AuthStatusCallback& callback, | 62 void OnAuthCompleted(const AuthStatusCallback& callback, |
| 63 GDataErrorCode error, | 63 GDataErrorCode error, |
| 64 const std::string& access_token); | 64 const std::string& access_token); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 75 // Note: This should remain the last member so it'll be destroyed and | 75 // Note: This should remain the last member so it'll be destroyed and |
| 76 // invalidate its weak pointers before any other members are destroyed. | 76 // invalidate its weak pointers before any other members are destroyed. |
| 77 base::WeakPtrFactory<AuthService> weak_ptr_factory_; | 77 base::WeakPtrFactory<AuthService> weak_ptr_factory_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(AuthService); | 79 DISALLOW_COPY_AND_ASSIGN(AuthService); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace google_apis | 82 } // namespace google_apis |
| 83 | 83 |
| 84 #endif // GOOGLE_APIS_DRIVE_AUTH_SERVICE_H_ | 84 #endif // GOOGLE_APIS_DRIVE_AUTH_SERVICE_H_ |
| OLD | NEW |