OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 class PrefService; | 31 class PrefService; |
32 | 32 |
33 namespace chromeos { | 33 namespace chromeos { |
34 | 34 |
35 // DeviceOAuth2TokenService retrieves OAuth2 access tokens for a given | 35 // DeviceOAuth2TokenService retrieves OAuth2 access tokens for a given |
36 // set of scopes using the device-level OAuth2 any-api refresh token | 36 // set of scopes using the device-level OAuth2 any-api refresh token |
37 // obtained during enterprise device enrollment. | 37 // obtained during enterprise device enrollment. |
38 // | 38 // |
39 // See |OAuth2TokenService| for usage details. | 39 // See |OAuth2TokenService| for usage details. |
40 // | 40 // |
41 // When using DeviceOAuth2TokenSerivce, a value of |GetRobotAccountId| should | 41 // When using DeviceOAuth2TokenService, a value of |GetRobotAccountId| should |
42 // be used in places where API expects |account_id|. | 42 // be used in places where API expects |account_id|. |
43 // | 43 // |
44 // Note that requests must be made from the UI thread. | 44 // Note that requests must be made from the UI thread. |
45 class DeviceOAuth2TokenService : public OAuth2TokenService, | 45 class DeviceOAuth2TokenService : public OAuth2TokenService, |
46 public gaia::GaiaOAuthClient::Delegate { | 46 public gaia::GaiaOAuthClient::Delegate { |
47 public: | 47 public: |
48 typedef base::Callback<void(bool)> StatusCallback; | 48 typedef base::Callback<void(bool)> StatusCallback; |
49 | 49 |
50 // Persist the given refresh token on the device. Overwrites any previous | 50 // Persist the given refresh token on the device. Overwrites any previous |
51 // value. Should only be called during initial device setup. Signals | 51 // value. Should only be called during initial device setup. Signals |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; | 163 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; |
164 | 164 |
165 base::WeakPtrFactory<DeviceOAuth2TokenService> weak_ptr_factory_; | 165 base::WeakPtrFactory<DeviceOAuth2TokenService> weak_ptr_factory_; |
166 | 166 |
167 DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenService); | 167 DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenService); |
168 }; | 168 }; |
169 | 169 |
170 } // namespace chromeos | 170 } // namespace chromeos |
171 | 171 |
172 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ | 172 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ |
OLD | NEW |