NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / extensions / signin / gaia_auth_extension_loader.h
blob5d8c9ebf9ef13f74165bacede9675d51f74cbee8
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_EXTENSIONS_SIGNIN_GAIA_AUTH_EXTENSION_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_SIGNIN_GAIA_AUTH_EXTENSION_LOADER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
11 class Profile;
13 namespace extensions {
15 // Manages and registers the gaia auth extension with the extension system.
16 class GaiaAuthExtensionLoader : public ProfileKeyedAPI {
17 public:
18 explicit GaiaAuthExtensionLoader(Profile* profile);
19 virtual ~GaiaAuthExtensionLoader();
21 // Load the gaia auth extension if the extension is not loaded yet.
22 void LoadIfNeeded();
23 // Unload the gaia auth extension if no pending reference.
24 void UnloadIfNeeded();
26 static GaiaAuthExtensionLoader* Get(Profile* profile);
28 // ProfileKeyedAPI implementation.
29 static ProfileKeyedAPIFactory<GaiaAuthExtensionLoader>* GetFactoryInstance();
31 private:
32 friend class ProfileKeyedAPIFactory<GaiaAuthExtensionLoader>;
34 // BrowserContextKeyedService overrides:
35 virtual void Shutdown() OVERRIDE;
37 // ProfileKeyedAPI implementation.
38 static const char* service_name() {
39 return "GaiaAuthExtensionLoader";
41 static const bool kServiceRedirectedInIncognito = true;
43 Profile* profile_;
44 int load_count_;
46 DISALLOW_COPY_AND_ASSIGN(GaiaAuthExtensionLoader);
49 } // namespace extensions
51 #endif // CHROME_BROWSER_EXTENSIONS_SIGNIN_GAIA_AUTH_EXTENSION_LOADER_H_