Index: chrome/browser/extensions/extension_menu_manager.cc |
diff --git a/chrome/browser/extensions/extension_menu_manager.cc b/chrome/browser/extensions/extension_menu_manager.cc |
index 48903fa19aeea6352164fbc24112a55d9644cdc4..2f7ff06fe2aabcce4aae45dd0dcea2fb3a1e5f4b 100644 |
--- a/chrome/browser/extensions/extension_menu_manager.cc |
+++ b/chrome/browser/extensions/extension_menu_manager.cc |
@@ -589,7 +589,7 @@ void ExtensionMenuManager::ExecuteCommand( |
if (item->type() == ExtensionMenuItem::RADIO) |
RadioItemSelected(item); |
- ListValue args; |
+ ListValue* args = new ListValue(); |
DictionaryValue* properties = new DictionaryValue(); |
SetIdKeyValue(properties, "menuItemId", item->id()); |
@@ -619,14 +619,14 @@ void ExtensionMenuManager::ExecuteCommand( |
properties->SetBoolean("editable", params.is_editable); |
- args.Append(properties); |
+ args->Append(properties); |
// Add the tab info to the argument list. |
// Note: web_contents only NULL in unit tests :( |
if (web_contents) |
- args.Append(ExtensionTabUtil::CreateTabValue(web_contents)); |
+ args->Append(ExtensionTabUtil::CreateTabValue(web_contents)); |
else |
- args.Append(new DictionaryValue()); |
+ args->Append(new DictionaryValue()); |
if (item->type() == ExtensionMenuItem::CHECKBOX || |
item->type() == ExtensionMenuItem::RADIO) { |
@@ -652,16 +652,12 @@ void ExtensionMenuManager::ExecuteCommand( |
GrantIfRequested(extension); |
} |
- std::string json_args; |
- base::JSONWriter::Write(&args, &json_args); |
event_router->DispatchEventToExtension( |
item->extension_id(), extension_event_names::kOnContextMenus, |
- json_args, profile, GURL(), |
- ExtensionEventRouter::USER_GESTURE_ENABLED); |
+ args, profile, GURL(), ExtensionEventRouter::USER_GESTURE_ENABLED); |
event_router->DispatchEventToExtension( |
item->extension_id(), extension_event_names::kOnContextMenuClicked, |
- json_args, profile, GURL(), |
- ExtensionEventRouter::USER_GESTURE_ENABLED); |
+ args, profile, GURL(), ExtensionEventRouter::USER_GESTURE_ENABLED); |
} |
void ExtensionMenuManager::SanitizeRadioList( |