OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "chrome/browser/signin/oauth2_token_service.h" | |
13 #include "net/url_request/url_request_context_getter.h" | |
14 | |
15 namespace net { | |
16 class URLRequestContextGetter; | |
17 } | |
18 | |
19 class GoogleServiceAuthError; | |
20 class PrefRegistrySimple; | |
21 class Profile; | |
22 | |
23 namespace chromeos { | |
24 | |
25 // DeviceOAuth2TokenService retrieves OAuth2 access tokens for a given | |
26 // set of scopes using the device-level OAuth2 any-api refresh token | |
27 // obtained during enterprise device enrollment. | |
28 // | |
29 // See |OAuth2TokenService| for usage details. | |
30 // | |
31 // Note that requests must be made from the UI thread. | |
32 class DeviceOAuth2TokenService : public OAuth2TokenService { | |
33 public: | |
34 virtual ~DeviceOAuth2TokenService(); | |
Andrew T Wilson (Slow)
2013/03/19 19:58:44
Hrm. constructor is private, but destructor is pub
David Roche
2013/03/21 00:12:02
Added comment that it's public due to use of scope
| |
35 | |
36 // Persist the given refresh token on the device. Overwrites any previous | |
37 // value. Should only be called during initial device setup. | |
38 void SaveRefreshToken(const std::string& refresh_token); | |
Andrew T Wilson (Slow)
2013/03/19 19:58:44
This is fine as-is, but consider making this "SetR
David Roche
2013/03/21 00:12:02
Done.
| |
39 | |
40 static void RegisterPrefs(PrefRegistrySimple* registry); | |
41 | |
42 protected: | |
43 virtual std::string GetRefreshToken() OVERRIDE; | |
44 | |
45 private: | |
46 explicit DeviceOAuth2TokenService(net::URLRequestContextGetter* getter); | |
47 friend class DeviceOAuth2TokenServiceFactory; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenService); | |
50 }; | |
51 | |
52 } // namespace chromeos | |
53 | |
54 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_H_ | |
OLD | NEW |