| 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..b9a596836e354d5ef9f81f3d3fbf45f331f3152c
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
|
| @@ -0,0 +1,44 @@
|
| +// 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"
|
| +
|
| +namespace chromeos {
|
| +
|
| +class DeviceOAuth2TokenService;
|
| +
|
| +class DeviceOAuth2TokenServiceFactory {
|
| + public:
|
| + // Returns the instance of the DeviceOAuth2TokenService singleton.
|
| + // May return null during browser startup and shutdown. Do not hold
|
| + // the pointer returned by this method; call this method every time
|
| + // and check for null to handle the case where this instance is destroyed
|
| + // during shutdown.
|
| + static DeviceOAuth2TokenService* Get();
|
| +
|
| + private:
|
| + friend class ChromeBrowserMainPartsChromeos;
|
| +
|
| + DeviceOAuth2TokenServiceFactory();
|
| +
|
| + // Called by ChromeBrowserMainPartsChromeOS in order to bootstrap the
|
| + // DeviceOAuth2TokenService instance after the required global data is
|
| + // available (local state and request context getter).
|
| + static void Initialize();
|
| +
|
| + // Called by ChromeBrowserMainPartsChromeOS in order to shutdown the
|
| + // DeviceOAuth2TokenService instance and cancel all in-flight requests
|
| + // before the required global data is destroyed (local state and request
|
| + // context getter).
|
| + static void Shutdown();
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenServiceFactory);
|
| +};
|
| +
|
| +} // namespace chromeos
|
| +
|
| +#endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_
|
|
|