extensions_delegate.h revision 03b57e008b61dfcb1fbad3aea950ae0e001748b0
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.
4
5#ifndef ATHENA_EXTENSIONS_PUBLIC_EXTENSIONS_DELEGATE_H_
6#define ATHENA_EXTENSIONS_PUBLIC_EXTENSIONS_DELEGATE_H_
7
8#include <string>
9
10#include "athena/athena_export.h"
11
12namespace content {
13class BrowserContext;
14}
15
16namespace extensions {
17class ExtensionSet;
18}
19
20namespace athena {
21
22// A delegate interface to extension implentation.
23class ATHENA_EXPORT ExtensionsDelegate {
24 public:
25  static ExtensionsDelegate* Get(content::BrowserContext* context);
26
27  // Creates the extension delegate for app shell environment.
28  static void CreateExtensionsDelegateForShell(
29      content::BrowserContext* context);
30
31  // Creates the extension delegate for test environment.
32  static void CreateExtensionsDelegateForTest();
33
34  // Deletes the singleton instance. This must be called in the reverse
35  // order of the initialization.
36  static void Shutdown();
37
38  ExtensionsDelegate();
39  virtual ~ExtensionsDelegate();
40
41  virtual content::BrowserContext* GetBrowserContext() const = 0;
42
43  // Returns the set of extensions that are currently installed.
44  virtual const extensions::ExtensionSet& GetInstalledExtensions() = 0;
45
46  // Launch an application specified by |app_id|.
47  virtual void LaunchApp(const std::string& app_id) = 0;
48};
49
50}  // namespace athena
51
52#endif  // ATHENA_EXTENSIONS_PUBLIC_EXTENSIONS_DELEGATE_H_
53