| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_API_EXTENSION_ACTION_EXTENSION_PAGE_ACTIONS_AP
I_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_PAGE_ACTIONS_AP
I_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_PAGE_ACTIONS_AP
I_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_PAGE_ACTIONS_AP
I_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/api/extension_action/extension_actions_api.h
" | 9 #include "chrome/browser/extensions/api/extension_action/extension_actions_api.h
" |
| 10 #include "chrome/browser/extensions/extension_function.h" | 10 #include "chrome/browser/extensions/extension_function.h" |
| 11 | 11 |
| 12 // Base class for deprecated page actions APIs | 12 // Base class for deprecated page actions APIs |
| 13 class PageActionsFunction : public SyncExtensionFunction { | 13 class PageActionsFunction : public SyncExtensionFunction { |
| 14 protected: | 14 protected: |
| 15 PageActionsFunction(); | 15 PageActionsFunction(); |
| 16 virtual ~PageActionsFunction(); | 16 virtual ~PageActionsFunction(); |
| 17 bool SetPageActionEnabled(bool enable); | 17 bool SetPageActionEnabled(bool enable); |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 // Implement chrome.pageActions.enableForTab(). | 20 // Implement chrome.pageActions.enableForTab(). |
| 21 class EnablePageActionsFunction : public PageActionsFunction { | 21 class EnablePageActionsFunction : public PageActionsFunction { |
| 22 public: |
| 23 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.enableForTab") |
| 24 |
| 25 protected: |
| 22 virtual ~EnablePageActionsFunction() {} | 26 virtual ~EnablePageActionsFunction() {} |
| 27 |
| 28 // ExtensionFunction: |
| 23 virtual bool RunImpl() OVERRIDE; | 29 virtual bool RunImpl() OVERRIDE; |
| 24 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.enableForTab") | |
| 25 }; | 30 }; |
| 26 | 31 |
| 27 // Implement chrome.pageActions.disableForTab(). | 32 // Implement chrome.pageActions.disableForTab(). |
| 28 class DisablePageActionsFunction : public PageActionsFunction { | 33 class DisablePageActionsFunction : public PageActionsFunction { |
| 34 public: |
| 35 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.disableForTab") |
| 36 |
| 37 protected: |
| 29 virtual ~DisablePageActionsFunction() {} | 38 virtual ~DisablePageActionsFunction() {} |
| 39 |
| 40 // ExtensionFunction: |
| 30 virtual bool RunImpl() OVERRIDE; | 41 virtual bool RunImpl() OVERRIDE; |
| 31 DECLARE_EXTENSION_FUNCTION_NAME("pageActions.disableForTab") | |
| 32 }; | 42 }; |
| 33 | 43 |
| 34 // | 44 // |
| 35 // pageAction.* aliases for supported extensionActions APIs. | 45 // pageAction.* aliases for supported extensionActions APIs. |
| 36 // | 46 // |
| 37 | 47 |
| 38 class PageActionShowFunction : public ExtensionActionShowFunction { | 48 class PageActionShowFunction : public ExtensionActionShowFunction { |
| 49 public: |
| 50 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.show") |
| 51 |
| 52 protected: |
| 39 virtual ~PageActionShowFunction() {} | 53 virtual ~PageActionShowFunction() {} |
| 40 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.show") | |
| 41 }; | 54 }; |
| 42 | 55 |
| 43 class PageActionHideFunction : public ExtensionActionHideFunction { | 56 class PageActionHideFunction : public ExtensionActionHideFunction { |
| 57 public: |
| 58 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.hide") |
| 59 |
| 60 protected: |
| 44 virtual ~PageActionHideFunction() {} | 61 virtual ~PageActionHideFunction() {} |
| 45 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.hide") | |
| 46 }; | 62 }; |
| 47 | 63 |
| 48 class PageActionSetIconFunction : public ExtensionActionSetIconFunction { | 64 class PageActionSetIconFunction : public ExtensionActionSetIconFunction { |
| 65 public: |
| 66 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setIcon") |
| 67 |
| 68 protected: |
| 49 virtual ~PageActionSetIconFunction() {} | 69 virtual ~PageActionSetIconFunction() {} |
| 50 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setIcon") | |
| 51 }; | 70 }; |
| 52 | 71 |
| 53 class PageActionSetTitleFunction : public ExtensionActionSetTitleFunction { | 72 class PageActionSetTitleFunction : public ExtensionActionSetTitleFunction { |
| 73 public: |
| 74 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setTitle") |
| 75 |
| 76 protected: |
| 54 virtual ~PageActionSetTitleFunction() {} | 77 virtual ~PageActionSetTitleFunction() {} |
| 55 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setTitle") | |
| 56 }; | 78 }; |
| 57 | 79 |
| 58 class PageActionSetPopupFunction : public ExtensionActionSetPopupFunction { | 80 class PageActionSetPopupFunction : public ExtensionActionSetPopupFunction { |
| 81 public: |
| 82 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setPopup") |
| 83 |
| 84 protected: |
| 59 virtual ~PageActionSetPopupFunction() {} | 85 virtual ~PageActionSetPopupFunction() {} |
| 60 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setPopup") | |
| 61 }; | 86 }; |
| 62 | 87 |
| 63 class PageActionGetTitleFunction : public ExtensionActionGetTitleFunction { | 88 class PageActionGetTitleFunction : public ExtensionActionGetTitleFunction { |
| 89 public: |
| 90 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.getTitle") |
| 91 |
| 92 protected: |
| 64 virtual ~PageActionGetTitleFunction() {} | 93 virtual ~PageActionGetTitleFunction() {} |
| 65 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.getTitle") | |
| 66 }; | 94 }; |
| 67 | 95 |
| 68 class PageActionGetPopupFunction : public ExtensionActionGetPopupFunction { | 96 class PageActionGetPopupFunction : public ExtensionActionGetPopupFunction { |
| 97 public: |
| 98 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.getPopup") |
| 99 |
| 100 protected: |
| 69 virtual ~PageActionGetPopupFunction() {} | 101 virtual ~PageActionGetPopupFunction() {} |
| 70 DECLARE_EXTENSION_FUNCTION_NAME("pageAction.getPopup") | |
| 71 }; | 102 }; |
| 72 | 103 |
| 73 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_PAGE_ACTIONS
_API_H_ | 104 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_PAGE_ACTIONS
_API_H_ |
| OLD | NEW |