Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8211)

Unified Diff: chrome/browser/extensions/api/extension_action/extension_actions_api.cc

Issue 10533108: Make calls to any extension action (page/browserAction) API not kill the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add todo Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/extension_action/extension_actions_api.cc
diff --git a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
index 9410fc97b9b826e221fd017dd8ccc03a04844c39..6e6c40595c0a2a26c310ab60ea82ed2988195a56 100644
--- a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
+++ b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
@@ -46,7 +46,13 @@ bool ExtensionActionFunction::RunImpl() {
extension_action_ = GetExtension()->browser_action();
if (!extension_action_)
extension_action_ = GetExtension()->page_action();
- EXTENSION_FUNCTION_VALIDATE(extension_action_);
+ if (!extension_action_) {
+ // TODO(kalman): ideally the browserAction/pageAction APIs wouldn't event
+ // exist for extensions that don't have one declared. This should come as
+ // part of the Feature system.
+ error_ = kNoExtensionActionError;
+ return false;
+ }
// There may or may not be details (depends on the function).
// The tabId might appear in details (if it exists) or as the first
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698