Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / extensions / signin / gaia_auth_extension_loader.h
blobb6234c067e24de0fc85742dccc7c18ab41ae1b89
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 // ProfileKeyedAPI implementation.
35 static const char* service_name() {
36 return "GaiaAuthExtensionLoader";
38 static const bool kServiceRedirectedInIncognito = true;
40 Profile* profile_;
41 int load_count_;
43 DISALLOW_COPY_AND_ASSIGN(GaiaAuthExtensionLoader);
46 } // namespace extensions
48 #endif // CHROME_BROWSER_EXTENSIONS_SIGNIN_GAIA_AUTH_EXTENSION_LOADER_H_