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"
13 namespace extensions
{
15 // Manages and registers the gaia auth extension with the extension system.
16 class GaiaAuthExtensionLoader
: public ProfileKeyedAPI
{
18 explicit GaiaAuthExtensionLoader(Profile
* profile
);
19 virtual ~GaiaAuthExtensionLoader();
21 // Load the gaia auth extension if the extension is not loaded yet.
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();
32 friend class ProfileKeyedAPIFactory
<GaiaAuthExtensionLoader
>;
34 // ProfileKeyedAPI implementation.
35 static const char* service_name() {
36 return "GaiaAuthExtensionLoader";
38 static const bool kServiceRedirectedInIncognito
= true;
43 DISALLOW_COPY_AND_ASSIGN(GaiaAuthExtensionLoader
);
46 } // namespace extensions
48 #endif // CHROME_BROWSER_EXTENSIONS_SIGNIN_GAIA_AUTH_EXTENSION_LOADER_H_