diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 04:35:08 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 04:35:08 +0000 |
commit | 92c6f9b9eac950c487f580709e3aab03843d15bc (patch) | |
tree | 4f25ceede36cf3655de577a48281910752f67262 /chrome/renderer/extensions | |
parent | 20ee7a74a7587986ed5db9b13aac2a78a5f0bdfc (diff) | |
download | chromium_src-92c6f9b9eac950c487f580709e3aab03843d15bc.zip chromium_src-92c6f9b9eac950c487f580709e3aab03843d15bc.tar.gz chromium_src-92c6f9b9eac950c487f580709e3aab03843d15bc.tar.bz2 |
Refactor BrowserActions, and add support for
tab-specific state.
Future changelists will move Page Actions over to
ExtensionAction2, then replace ExtensionAction and
ExtensionActionState with ExtensionAction2.
Also, fix a bug in setIcon({path:...}) where it
would work only the first time.
BUG=24669,24472
Review URL: http://codereview.chromium.org/306044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r-- | chrome/renderer/extensions/extension_process_bindings.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc index a9360eb..428281e 100644 --- a/chrome/renderer/extensions/extension_process_bindings.cc +++ b/chrome/renderer/extensions/extension_process_bindings.cc @@ -416,7 +416,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 = @@ -453,7 +452,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); } |