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_ACTIONS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTIONS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTIONS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTIONS_API_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/extensions/extension_action.h" | 9 #include "chrome/browser/extensions/extension_action.h" |
10 #include "chrome/browser/extensions/extension_function.h" | 10 #include "chrome/browser/extensions/extension_function.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 class ExtensionActionFunction : public SyncExtensionFunction { | 60 class ExtensionActionFunction : public SyncExtensionFunction { |
61 public: | 61 public: |
62 static bool ParseCSSColorString(const std::string& color_string, | 62 static bool ParseCSSColorString(const std::string& color_string, |
63 SkColor* result); | 63 SkColor* result); |
64 | 64 |
65 protected: | 65 protected: |
66 ExtensionActionFunction(); | 66 ExtensionActionFunction(); |
67 virtual ~ExtensionActionFunction(); | 67 virtual ~ExtensionActionFunction(); |
68 virtual bool RunImpl() OVERRIDE; | 68 virtual bool RunImpl() OVERRIDE; |
69 virtual bool RunExtensionAction() = 0; | 69 virtual bool RunExtensionAction() = 0; |
| 70 virtual bool ValidateArguments(); |
| 71 |
70 void NotifyChange(); | 72 void NotifyChange(); |
71 void NotifyBrowserActionChange(); | 73 void NotifyBrowserActionChange(); |
72 void NotifyLocationBarChange(); | 74 void NotifyLocationBarChange(); |
| 75 void NotifyStatusTrayChange(); |
73 bool SetVisible(bool visible); | 76 bool SetVisible(bool visible); |
74 | 77 |
75 // Extension-related information for |tab_id_|. | 78 // Extension-related information for |tab_id_|. |
76 // CHECK-fails if there is no tab. | 79 // CHECK-fails if there is no tab. |
77 extensions::TabHelper& tab_helper() const; | 80 extensions::TabHelper& tab_helper() const; |
78 | 81 |
79 // All the extension action APIs take a single argument called details that | 82 // All the extension action APIs take a single argument called details that |
80 // is a dictionary. | 83 // is a dictionary. |
81 base::DictionaryValue* details_; | 84 base::DictionaryValue* details_; |
82 | 85 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 174 |
172 // getBadgeBackgroundColor | 175 // getBadgeBackgroundColor |
173 class ExtensionActionGetBadgeBackgroundColorFunction | 176 class ExtensionActionGetBadgeBackgroundColorFunction |
174 : public ExtensionActionFunction { | 177 : public ExtensionActionFunction { |
175 protected: | 178 protected: |
176 virtual ~ExtensionActionGetBadgeBackgroundColorFunction() {} | 179 virtual ~ExtensionActionGetBadgeBackgroundColorFunction() {} |
177 virtual bool RunExtensionAction() OVERRIDE; | 180 virtual bool RunExtensionAction() OVERRIDE; |
178 }; | 181 }; |
179 | 182 |
180 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTIONS_API_
H_ | 183 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTIONS_API_
H_ |
OLD | NEW |