[Android] Allow multiple --install in bb_device_steps.py.
[chromium-blink-merge.git] / chrome / browser / chromeos / settings / device_oauth2_token_service_factory.h
blob8b20c88c804966c820e46c6fed7fc3118754e820
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_
8 #include <queue>
9 #include <string>
11 #include "base/basictypes.h"
13 namespace chromeos {
15 class DeviceOAuth2TokenService;
17 class DeviceOAuth2TokenServiceFactory {
18 public:
19 // Returns the instance of the DeviceOAuth2TokenService singleton. May return
20 // NULL during browser startup and shutdown. When calling Get(), either make
21 // sure that your code executes after browser startup and before shutdown or
22 // be careful to call Get() every time (instead of holding a pointer) and
23 // check for NULL to handle cases where you might access
24 // DeviceOAuth2TokenService during startup or shutdown.
25 static DeviceOAuth2TokenService* Get();
27 // Called by ChromeBrowserMainPartsChromeOS in order to bootstrap the
28 // DeviceOAuth2TokenService instance after the required global data is
29 // available (local state and request context getter).
30 static void Initialize();
32 // Called by ChromeBrowserMainPartsChromeOS in order to shutdown the
33 // DeviceOAuth2TokenService instance and cancel all in-flight requests before
34 // the required global data is destroyed (local state and request context
35 // getter).
36 static void Shutdown();
38 private:
39 DeviceOAuth2TokenServiceFactory();
40 ~DeviceOAuth2TokenServiceFactory();
42 DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenServiceFactory);
45 } // namespace chromeos
47 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_