| 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_BROWSER_ACTIONS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_ACTIONS_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_ACTIONS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_ACTIONS_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
| 9 #include "chrome/common/extensions/extension_action.h" | 9 #include "chrome/common/extensions/extension_action.h" |
| 10 | 10 |
| 11 class ExtensionAction; | 11 class ExtensionAction; |
| 12 class ExtensionActionState; | 12 class ExtensionActionState; |
| 13 | 13 |
| 14 class BrowserActionFunction : public SyncExtensionFunction { | 14 class BrowserActionFunction : public SyncExtensionFunction { |
| 15 protected: | 15 protected: |
| 16 BrowserActionFunction() : tab_id_(ExtensionAction::kDefaultTabId) {} | 16 BrowserActionFunction() : tab_id_(ExtensionAction::kDefaultTabId) {} |
| 17 virtual ~BrowserActionFunction() {} | 17 virtual ~BrowserActionFunction() {} |
| 18 virtual bool RunImpl(); | 18 virtual bool RunImpl(); |
| 19 virtual bool RunBrowserAction() = 0; | 19 virtual bool RunBrowserAction() = 0; |
| 20 | 20 |
| 21 // All the browser action APIs take a single argument called details that is | 21 // All the browser action APIs take a single argument called details that is |
| 22 // a dictionary. | 22 // a dictionary. |
| 23 DictionaryValue* details_; | 23 const DictionaryValue* details_; |
| 24 | 24 |
| 25 // The tab id the browser action function should apply to, if any, or | 25 // The tab id the browser action function should apply to, if any, or |
| 26 // kDefaultTabId if none was specified. | 26 // kDefaultTabId if none was specified. |
| 27 int tab_id_; | 27 int tab_id_; |
| 28 | 28 |
| 29 // The browser action for the current extension. | 29 // The browser action for the current extension. |
| 30 ExtensionAction* browser_action_; | 30 ExtensionAction* browser_action_; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class BrowserActionSetIconFunction : public BrowserActionFunction { | 33 class BrowserActionSetIconFunction : public BrowserActionFunction { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class BrowserActionSetBadgeBackgroundColorFunction | 51 class BrowserActionSetBadgeBackgroundColorFunction |
| 52 : public BrowserActionFunction { | 52 : public BrowserActionFunction { |
| 53 ~BrowserActionSetBadgeBackgroundColorFunction() {} | 53 ~BrowserActionSetBadgeBackgroundColorFunction() {} |
| 54 virtual bool RunBrowserAction(); | 54 virtual bool RunBrowserAction(); |
| 55 DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setBadgeBackgroundColor") | 55 DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setBadgeBackgroundColor") |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_ACTIONS_API_H_ | 58 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_ACTIONS_API_H_ |
| OLD | NEW |