From 2e3b520ff4318342b027ea8aa303e5981ea9ce79 Mon Sep 17 00:00:00 2001 From: "asargent@chromium.org" Date: Tue, 23 Mar 2010 06:52:41 +0000 Subject: Initial version of an experimental Extensions Context Menu API. The proposal for the API is documented at: http://dev.chromium.org/developers/design-documents/extensions/context-menu-api Notable limitations in this initial implementation: -No reliable way to get at the unique, actual node clicked on in contexts like IMAGE/LINK/etc. We'll need to fix this in the long run - see the API proposal page for some notes on this. -No update or deleteAll methods ; the only way you can change items is to delete by id and re-add. -We aren't yet matching the UI goal of having the extension items at the top level include the extension icon on the left. This will require a refactoring of RenderViewContextMenu to steal some of the code from the bookmarks bar context menus, which can display favicons. -The only kind of parent->child menu that currently works is if you have a single top-level parent, and only one level of children. (This is because of how RenderViewContextMenu currently works) -No browser tests that the menu items actually get drawn (will wait on those until the above mentioned refactor is complete), or API tests (the API may change a bit based on feedback, at which point I'll write more tests). -Unit tests need to cover some more cases. BUG=32363 TEST=Should be able to create context menus with this API. Review URL: http://codereview.chromium.org/1042003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42321 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_message_service.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'chrome/browser/extensions/extension_message_service.h') diff --git a/chrome/browser/extensions/extension_message_service.h b/chrome/browser/extensions/extension_message_service.h index 6b8ade6..7d7540e 100644 --- a/chrome/browser/extensions/extension_message_service.h +++ b/chrome/browser/extensions/extension_message_service.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -81,7 +81,7 @@ class ExtensionMessageService void PostMessageFromRenderer(int port_id, const std::string& message); // Send an event to every registered extension renderer. - void DispatchEventToRenderers( + virtual void DispatchEventToRenderers( const std::string& event_name, const std::string& event_args, bool has_incognito_data); @@ -132,11 +132,12 @@ class ExtensionMessageService private: friend class ChromeThread; friend class DeleteTask; + friend class MockExtensionMessageService; // A map of channel ID to its channel object. typedef std::map MessageChannelMap; - ~ExtensionMessageService(); + virtual ~ExtensionMessageService(); // Allocates a pair of port ids. // NOTE: this can be called from any thread. -- cgit v1.1