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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void OnRefreshTokenAvailable(const std::string& account_id) override; | 53 void OnRefreshTokenAvailable(const std::string& account_id) override; |
54 void OnRefreshTokenRevoked(const std::string& account_id) override; | 54 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 DriveApiErrorCode error, |
64 const std::string& access_token); | 64 const std::string& access_token); |
65 | 65 |
66 OAuth2TokenService* oauth2_token_service_; | 66 OAuth2TokenService* oauth2_token_service_; |
67 std::string account_id_; | 67 std::string account_id_; |
68 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 68 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
69 bool has_refresh_token_; | 69 bool has_refresh_token_; |
70 std::string access_token_; | 70 std::string access_token_; |
71 std::vector<std::string> scopes_; | 71 std::vector<std::string> scopes_; |
72 ObserverList<AuthServiceObserver> observers_; | 72 ObserverList<AuthServiceObserver> observers_; |
73 base::ThreadChecker thread_checker_; | 73 base::ThreadChecker thread_checker_; |
74 | 74 |
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 |