1 // Copyright 2014 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 ATHENA_EXTENSIONS_PUBLIC_EXTENSIONS_DELEGATE_H_
6 #define ATHENA_EXTENSIONS_PUBLIC_EXTENSIONS_DELEGATE_H_
10 #include "athena/athena_export.h"
11 #include "base/memory/scoped_ptr.h"
18 namespace extensions
{
19 class ExtensionInstallUI
;
25 // A delegate interface to extension implentation.
26 class ATHENA_EXPORT ExtensionsDelegate
{
28 static ExtensionsDelegate
* Get(content::BrowserContext
* context
);
30 // Creates the extension delegate.
31 static void CreateExtensionsDelegate(
32 content::BrowserContext
* context
);
34 // Creates the extension delegate for test environment.
35 static void CreateExtensionsDelegateForTest();
37 // Deletes the singleton instance. This must be called in the reverse
38 // order of the initialization.
39 static void Shutdown();
42 virtual ~ExtensionsDelegate();
44 virtual content::BrowserContext
* GetBrowserContext() const = 0;
46 // Returns the set of extensions that are currently installed.
47 virtual const extensions::ExtensionSet
& GetInstalledExtensions() = 0;
49 // Starts an application. Returns true if the application was
50 // successfully started.
51 // TODO(oshima): Add launcher source type. (see chrome_launcher_types.h)
52 virtual bool LaunchApp(const std::string
& app_id
) = 0;
54 // Unload an application. Returns true if the application was
55 // successfully unloaded.
56 virtual bool UnloadApp(const std::string
& app_id
) = 0;
58 virtual scoped_ptr
<extensions::ExtensionInstallUI
>
59 CreateExtensionInstallUI() = 0;
64 #endif // ATHENA_EXTENSIONS_PUBLIC_EXTENSIONS_DELEGATE_H_