Chromium Code Reviews| Index: chrome/browser/extensions/menu_manager.cc |
| diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc |
| index 1ec348019e6022453c10e96e11fd6b05d70deb15..30f545f8ee86aa75784f2aeaef8ac86149fb724b 100644 |
| --- a/chrome/browser/extensions/menu_manager.cc |
| +++ b/chrome/browser/extensions/menu_manager.cc |
| @@ -583,7 +583,7 @@ void MenuManager::ExecuteCommand(Profile* profile, |
| if (item->type() == MenuItem::RADIO) |
| RadioItemSelected(item); |
| - ListValue args; |
| + ListValue* args = new ListValue(); |
| DictionaryValue* properties = new DictionaryValue(); |
| SetIdKeyValue(properties, "menuItemId", item->id()); |
| @@ -613,14 +613,14 @@ void MenuManager::ExecuteCommand(Profile* profile, |
| 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() == MenuItem::CHECKBOX || |
| item->type() == MenuItem::RADIO) { |
| @@ -646,16 +646,12 @@ void MenuManager::ExecuteCommand(Profile* profile, |
| 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); |
|
miket_OOO
2012/07/10 22:33:19
I think args is dead by this point.
|
| } |
| void MenuManager::SanitizeRadioList(const MenuItem::List& item_list) { |