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

Unified Diff: chrome/renderer/extensions/extension_process_bindings.cc

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too Created 11 years, 2 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
Index: chrome/renderer/extensions/extension_process_bindings.cc
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc
index 9641c23018437c872c68f6e6ab22d813058b0bbe..c8aee569e2fd87955db1a30ca60d3c73fd1ce490 100644
--- a/chrome/renderer/extensions/extension_process_bindings.cc
+++ b/chrome/renderer/extensions/extension_process_bindings.cc
@@ -415,7 +415,6 @@ class ExtensionImpl : public ExtensionBase {
// before sending the request to the browser.
static v8::Handle<v8::Value> SetExtensionActionIcon(const v8::Arguments& args) {
v8::Local<v8::Object> details = args[1]->ToObject();
- int tab_id = details->Get(v8::String::New("tabId"))->Int32Value();
v8::Local<v8::Object> image_data =
details->Get(v8::String::New("imageData"))->ToObject();
v8::Local<v8::Object> data =
@@ -452,7 +451,11 @@ class ExtensionImpl : public ExtensionBase {
DictionaryValue* dict = new DictionaryValue();
dict->Set(L"imageData", bitmap_value);
- dict->SetInteger(L"tabId", tab_id);
+
+ if (details->Has(v8::String::New("tabId"))) {
+ dict->SetInteger(L"tabId",
+ details->Get(v8::String::New("tabId"))->Int32Value());
+ }
return StartRequestCommon(args, dict);
}
« no previous file with comments | « chrome/common/extensions/extension_action2_unittest.cc ('k') | chrome/renderer/resources/extension_process_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698