Chromium Code Reviews| Index: chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h |
| diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h b/chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8801317b2efdd1a93270b891d33ee94c6773e223 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ |
| +#define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" |
| + |
| +namespace base { |
| +template <typename T> struct DefaultLazyInstanceTraits; |
| +} |
| + |
| +namespace chromeos { |
| + |
| +class DeviceOAuth2TokenServiceFactory { |
| + public: |
| + // Returns the instance of the DeviceOAuth2TokenService singleton. |
| + // May return null during browser startup and shutdown. |
| + static DeviceOAuth2TokenService* Get(); |
| + |
| + // 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
|
| + static void Initialize(); |
| + static void Shutdown(); |
| + private: |
| + friend struct base::DefaultLazyInstanceTraits< |
| + chromeos::DeviceOAuth2TokenServiceFactory>; |
| + |
| + DeviceOAuth2TokenServiceFactory(); |
| + virtual ~DeviceOAuth2TokenServiceFactory(); |
| + |
| + DeviceOAuth2TokenService* GetImpl(); |
| + |
| + // Called by ChromeBrowserMainPartsChromeOS in order to bootstrap our |
| + // DeviceOAuth2TokenService instance after the required global data is |
| + // available (local state and request context getter). |
| + void InitializeImpl(); |
| + void ShutdownImpl(); |
| + |
| + scoped_ptr<DeviceOAuth2TokenService> device_oauth2_token_service_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenServiceFactory); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ |