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_FACTORY_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" | |
11 | |
12 namespace base { | |
13 template <typename T> struct DefaultLazyInstanceTraits; | |
14 } | |
15 | |
16 namespace chromeos { | |
17 | |
18 class DeviceOAuth2TokenServiceFactory { | |
19 public: | |
20 // Returns the instance of the DeviceOAuth2TokenService singleton. | |
21 // May return null during browser startup and shutdown. | |
22 static DeviceOAuth2TokenService* Get(); | |
23 | |
24 // TODO: Move back... | |
Mattias Nissler (ping if slow)
2013/04/03 11:33:16
Where?
David Roche
2013/04/03 16:34:09
To private: after I figured out why the friend cla
| |
25 static void Initialize(); | |
26 static void Shutdown(); | |
27 private: | |
28 friend struct base::DefaultLazyInstanceTraits< | |
29 chromeos::DeviceOAuth2TokenServiceFactory>; | |
30 | |
31 DeviceOAuth2TokenServiceFactory(); | |
32 virtual ~DeviceOAuth2TokenServiceFactory(); | |
33 | |
34 DeviceOAuth2TokenService* GetImpl(); | |
35 | |
36 // Called by ChromeBrowserMainPartsChromeOS in order to bootstrap our | |
37 // DeviceOAuth2TokenService instance after the required global data is | |
38 // available (local state and request context getter). | |
39 void InitializeImpl(); | |
40 void ShutdownImpl(); | |
41 | |
42 scoped_ptr<DeviceOAuth2TokenService> device_oauth2_token_service_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenServiceFactory); | |
45 }; | |
46 | |
47 } // namespace chromeos | |
48 | |
49 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_ H_ | |
OLD | NEW |