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"
12 class AppListSyncableService
;
16 namespace extensions
{
18 class LauncherPageAPI
: public BrowserContextKeyedAPI
{
20 explicit LauncherPageAPI(content::BrowserContext
* context
);
21 ~LauncherPageAPI() override
;
23 app_list::AppListSyncableService
* GetService() const;
24 static BrowserContextKeyedAPIFactory
<LauncherPageAPI
>* GetFactoryInstance();
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
{
39 DECLARE_EXTENSION_FUNCTION("launcherPage.pushSubpage",
40 LAUNCHERPAGE_PUSHSUBPAGE
);
42 LauncherPagePushSubpageFunction();
45 ~LauncherPagePushSubpageFunction() override
{}
47 ResponseAction
Run() override
;
50 DISALLOW_COPY_AND_ASSIGN(LauncherPagePushSubpageFunction
);
53 class LauncherPageShowFunction
: public UIThreadExtensionFunction
{
55 DECLARE_EXTENSION_FUNCTION("launcherPage.show", LAUNCHERPAGE_SHOW
);
57 LauncherPageShowFunction();
60 ~LauncherPageShowFunction() override
{}
62 ResponseAction
Run() override
;
65 DISALLOW_COPY_AND_ASSIGN(LauncherPageShowFunction
);
68 class LauncherPageHideFunction
: public UIThreadExtensionFunction
{
70 DECLARE_EXTENSION_FUNCTION("launcherPage.hide", LAUNCHERPAGE_HIDE
);
72 LauncherPageHideFunction();
75 ~LauncherPageHideFunction() override
{}
77 ResponseAction
Run() override
;
80 DISALLOW_COPY_AND_ASSIGN(LauncherPageHideFunction
);
83 class LauncherPageSetEnabledFunction
: public UIThreadExtensionFunction
{
85 DECLARE_EXTENSION_FUNCTION("launcherPage.setEnabled",
86 LAUNCHERPAGE_SETENABLED
);
88 LauncherPageSetEnabledFunction();
91 ~LauncherPageSetEnabledFunction() override
{}
93 ResponseAction
Run() override
;
96 DISALLOW_COPY_AND_ASSIGN(LauncherPageSetEnabledFunction
);
99 } // namespace extensions
101 #endif // CHROME_BROWSER_EXTENSIONS_API_LAUNCHER_PAGE_LAUNCHER_PAGE_API_H_