OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PAGE_ACTIONS_MODULE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PAGE_ACTIONS_MODULE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PAGE_ACTIONS_MODULE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PAGE_ACTIONS_MODULE_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
9 | 9 |
| 10 class TabContents; |
| 11 class ExtensionAction; |
| 12 class ExtensionActionState; |
| 13 |
10 class PageActionFunction : public SyncExtensionFunction { | 14 class PageActionFunction : public SyncExtensionFunction { |
11 protected: | 15 protected: |
12 bool SetPageActionEnabled(bool enable); | 16 bool SetPageActionEnabled(bool enable); |
| 17 |
| 18 bool InitCommon(int tab_id); |
| 19 bool SetHidden(bool hidden); |
| 20 |
| 21 ExtensionAction* page_action_; |
| 22 TabContents* contents_; |
| 23 ExtensionActionState* state_; |
13 }; | 24 }; |
14 | 25 |
15 class EnablePageActionFunction : public PageActionFunction { | 26 class EnablePageActionFunction : public PageActionFunction { |
16 virtual bool RunImpl(); | 27 virtual bool RunImpl(); |
17 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.enableForTab") | 28 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.enableForTab") |
18 }; | 29 }; |
19 | 30 |
20 class DisablePageActionFunction : public PageActionFunction { | 31 class DisablePageActionFunction : public PageActionFunction { |
21 virtual bool RunImpl(); | 32 virtual bool RunImpl(); |
22 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.disableForTab") | 33 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.disableForTab") |
23 }; | 34 }; |
24 | 35 |
| 36 class PageActionShowFunction : public PageActionFunction { |
| 37 virtual bool RunImpl(); |
| 38 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.show") |
| 39 }; |
| 40 |
| 41 class PageActionHideFunction : public PageActionFunction { |
| 42 virtual bool RunImpl(); |
| 43 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.hide") |
| 44 }; |
| 45 |
| 46 class PageActionSetIconFunction : public PageActionFunction { |
| 47 virtual bool RunImpl(); |
| 48 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setIcon") |
| 49 }; |
| 50 |
| 51 class PageActionSetTitleFunction : public PageActionFunction { |
| 52 virtual bool RunImpl(); |
| 53 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setTitle") |
| 54 }; |
| 55 |
| 56 class PageActionSetBadgeBackgroundColorFunction : public PageActionFunction { |
| 57 virtual bool RunImpl(); |
| 58 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setBadgeBackgroundColor") |
| 59 }; |
| 60 |
| 61 class PageActionSetBadgeTextColorFunction : public PageActionFunction { |
| 62 virtual bool RunImpl(); |
| 63 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setBadgeTextColor") |
| 64 }; |
| 65 |
| 66 class PageActionSetBadgeTextFunction : public PageActionFunction { |
| 67 virtual bool RunImpl(); |
| 68 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setBadgeText") |
| 69 }; |
| 70 |
25 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PAGE_ACTIONS_MODULE_H_ | 71 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PAGE_ACTIONS_MODULE_H_ |
OLD | NEW |