From a11fa3437fdbb89ebe1e3a61cb4fc1de1ae4a352 Mon Sep 17 00:00:00 2001 From: "asargent@chromium.org" Date: Fri, 9 Jul 2010 16:56:00 +0000 Subject: Some cleanup of the extensions context menu API. This CL contains the following: -Use lower case names for enum values in the create/update properties (eg 'page' instead of 'PAGE') -Make the top-level API name plural (contextMenus instead of contextMenu) -Don't fire onclick handlers for a parent menu item when one of its children is clicked on. -Remove the enabledContexts property for now, to eventually be replaced with a way to programmatically enable/disable. There are a few more things in the bug that I'll be doing in subsequent CL's. BUG=48198 TEST=Extensions using the context menu API should work with the changes described above. Review URL: http://codereview.chromium.org/2887013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51970 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_menu_manager.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to '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 42e3842..fc02637 100644 --- a/chrome/browser/extensions/extension_menu_manager.cc +++ b/chrome/browser/extensions/extension_menu_manager.cc @@ -27,15 +27,13 @@ ExtensionMenuItem::ExtensionMenuItem(const std::string& extension_id, std::string title, bool checked, Type type, - const ContextList& contexts, - const ContextList& enabled_contexts) + const ContextList& contexts) : extension_id_(extension_id), title_(title), id_(0), type_(type), checked_(checked), contexts_(contexts), - enabled_contexts_(enabled_contexts), parent_id_(0) {} ExtensionMenuItem::~ExtensionMenuItem() { @@ -439,7 +437,7 @@ void ExtensionMenuManager::ExecuteCommand(Profile* profile, std::string json_args; base::JSONWriter::Write(&args, false, &json_args); - std::string event_name = "contextMenu/" + item->extension_id(); + std::string event_name = "contextMenus/" + item->extension_id(); service->DispatchEventToRenderers(event_name, json_args, profile->IsOffTheRecord(), GURL()); } -- cgit v1.1