Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / extensions / api / launcher_page / launcher_page_api.h
blobbd39314338c07db830b245a5eb03c6a31b19413c
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 CHROME_BROWSER_EXTENSIONS_API_LAUNCHER_PAGE_LAUNCHER_PAGE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_LAUNCHER_PAGE_LAUNCHER_PAGE_API_H_
8 #include "chrome/browser/extensions/chrome_extension_function.h"
9 #include "extensions/browser/browser_context_keyed_api_factory.h"
11 namespace app_list {
12 class AppListSyncableService;
13 class AppListModel;
16 namespace extensions {
18 class LauncherPageAPI : public BrowserContextKeyedAPI {
19 public:
20 explicit LauncherPageAPI(content::BrowserContext* context);
21 ~LauncherPageAPI() override;
23 app_list::AppListSyncableService* GetService() const;
24 static BrowserContextKeyedAPIFactory<LauncherPageAPI>* GetFactoryInstance();
26 private:
27 friend class BrowserContextKeyedAPIFactory<LauncherPageAPI>;
29 // BrowserContextKeyedAPI implementation.
30 static const char* service_name() { return "LauncherPageAPI"; }
32 static const bool kServiceHasOwnInstanceInIncognito = true;
34 app_list::AppListSyncableService* service_;
37 class LauncherPagePushSubpageFunction : public UIThreadExtensionFunction {
38 public:
39 DECLARE_EXTENSION_FUNCTION("launcherPage.pushSubpage",
40 LAUNCHERPAGE_PUSHSUBPAGE);
42 LauncherPagePushSubpageFunction();
44 protected:
45 ~LauncherPagePushSubpageFunction() override {}
47 ResponseAction Run() override;
49 private:
50 DISALLOW_COPY_AND_ASSIGN(LauncherPagePushSubpageFunction);
53 class LauncherPageShowFunction : public UIThreadExtensionFunction {
54 public:
55 DECLARE_EXTENSION_FUNCTION("launcherPage.show", LAUNCHERPAGE_SHOW);
57 LauncherPageShowFunction();
59 protected:
60 ~LauncherPageShowFunction() override {}
62 ResponseAction Run() override;
64 private:
65 DISALLOW_COPY_AND_ASSIGN(LauncherPageShowFunction);
68 class LauncherPageHideFunction : public UIThreadExtensionFunction {
69 public:
70 DECLARE_EXTENSION_FUNCTION("launcherPage.hide", LAUNCHERPAGE_HIDE);
72 LauncherPageHideFunction();
74 protected:
75 ~LauncherPageHideFunction() override {}
77 ResponseAction Run() override;
79 private:
80 DISALLOW_COPY_AND_ASSIGN(LauncherPageHideFunction);
83 class LauncherPageSetEnabledFunction : public UIThreadExtensionFunction {
84 public:
85 DECLARE_EXTENSION_FUNCTION("launcherPage.setEnabled",
86 LAUNCHERPAGE_SETENABLED);
88 LauncherPageSetEnabledFunction();
90 protected:
91 ~LauncherPageSetEnabledFunction() override {}
93 ResponseAction Run() override;
95 private:
96 DISALLOW_COPY_AND_ASSIGN(LauncherPageSetEnabledFunction);
99 } // namespace extensions
101 #endif // CHROME_BROWSER_EXTENSIONS_API_LAUNCHER_PAGE_LAUNCHER_PAGE_API_H_