Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Issue 1042003: Initial version of an experimental Extensions Context Menu API.... (Closed)

Created:
10 years, 9 months ago by asargent_no_longer_on_chrome
Modified:
9 years, 7 months ago
CC:
chromium-reviews, jam+cc_chromium.org, brettw+cc_chromium.org, ben+cc_chromium.org, Erik does not do reviews, Aaron Boodman, pam+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=42321

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 219

Patch Set 3 : '' #

Total comments: 10

Patch Set 4 : '' #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+1479 lines, -12 lines) Patch
M chrome/app/chrome_dll_resource.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_context_menu_api.h View 1 chunk +22 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_context_menu_api.cc View 1 2 1 chunk +149 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_function.h View 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_function_dispatcher.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_menu_manager.h View 1 2 3 1 chunk +221 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_menu_manager.cc View 1 2 1 chunk +335 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_menu_manager_unittest.cc View 1 2 3 1 chunk +297 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_message_service.h View 1 2 3 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/extensions/extensions_service.h View 1 2 3 4 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.h View 1 2 3 3 chunks +39 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 2 3 10 chunks +242 lines, -3 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/extension_api.json View 1 2 3 1 chunk +89 lines, -0 lines 0 comments Download
M chrome/renderer/resources/extension_process_bindings.js View 1 2 3 7 chunks +51 lines, -4 lines 5 comments Download
M chrome/renderer/resources/renderer_extension_bindings.js View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
asargent_no_longer_on_chrome
10 years, 9 months ago (2010-03-17 00:26:54 UTC) #1
Paweł Hajdan Jr.
Drive-by with minor test comments. By the way, please watch for the API test flakiness ...
10 years, 9 months ago (2010-03-17 06:44:43 UTC) #2
Finnur
Overall, looks promising. I have a few requests for clarification, a few things I'm concerned ...
10 years, 9 months ago (2010-03-17 21:01:04 UTC) #3
Finnur
And there are some compile errors in the unit test, looks like...
10 years, 9 months ago (2010-03-17 21:02:39 UTC) #4
asargent_no_longer_on_chrome
Ok, I believe I've addressed all of the comments (phew!). Finnur - I'll get Rafael ...
10 years, 9 months ago (2010-03-21 19:50:16 UTC) #5
Paweł Hajdan Jr.
The bits I commented in the drive-by LGTM.
10 years, 9 months ago (2010-03-21 20:28:11 UTC) #6
Finnur
Minor issues... http://codereview.chromium.org/1042003/diff/13001/14008 File chrome/browser/extensions/extension_menu_manager_unittest.cc (right): http://codereview.chromium.org/1042003/diff/13001/14008#newcode33 chrome/browser/extensions/extension_menu_manager_unittest.cc:33: static ExtensionMenuItem* GetTestItem(DictionaryValue* properties) { nit: And ...
10 years, 9 months ago (2010-03-22 17:18:12 UTC) #7
asargent_no_longer_on_chrome
Finnur - all comments addressed, I believe. Rafael - could you take a look at ...
10 years, 9 months ago (2010-03-22 20:20:04 UTC) #8
Finnur
LGTM
10 years, 9 months ago (2010-03-22 20:25:28 UTC) #9
rafaelw
lgtm w/ nits on extension_process_bindings.js http://codereview.chromium.org/1042003/diff/51001/52016 File chrome/renderer/resources/extension_process_bindings.js (right): http://codereview.chromium.org/1042003/diff/51001/52016#newcode83 chrome/renderer/resources/extension_process_bindings.js:83: if (request.customCallback) need curly ...
10 years, 9 months ago (2010-03-22 22:27:20 UTC) #10
rafaelw1
p.s. http://www.corp.google.com/eng/doc/javascriptguide.html#curlybraces On Mon, Mar 22, 2010 at 3:27 PM, <[email protected]> wrote: > lgtm w/ ...
10 years, 9 months ago (2010-03-22 22:32:01 UTC) #11
godmar
Is it possible to update the displayed 'string' in a menu item while it is ...
10 years, 9 months ago (2010-03-23 13:23:08 UTC) #12
asargent_no_longer_on_chrome
It's possible we'll eventually support something like this, but not initially (the existing context menu ...
10 years, 9 months ago (2010-03-23 17:40:04 UTC) #13
godmar
Thanks for the reply. Just to clarify: the initial version also will not support the ...
10 years, 9 months ago (2010-03-23 17:48:37 UTC) #14
asargent_no_longer_on_chrome
10 years, 9 months ago (2010-03-24 18:34:36 UTC) #15
Right, that is not currently supported by the initial version.

Thanks for the feedback! Hearing about more use cases like this will help us
weigh how we might modify the API. FYI, I'm about to send out a request for
feedback to the [email protected] mailing list, so let's move
further conversation there.


On Tue, Mar 23, 2010 at 5:48 PM, <[email protected]> wrote:

>
> Thanks for the reply.
>
> Just to clarify: the initial version also will not support the
> displaying/hiding
> of entire menu entries based on what the user selected on the page (because
> supporting that would require a 'beforeShowing' callback?)
>
> In our extension, we allow users to configure what they wish to see in the
> context menu based on what is selected. For instance, if a user selects a
> DOI
> (10.xxxx/yyyy), an entry appears to handle DOIs. If a user selects an ISBN
> or
> ISSN, we recognize the checksum and offer an appropriate option. It would
> be
> unfortunate to lose this functionality in our Chrome version.
>
>
> On 2010/03/23 17:40:04, Antony Sargent wrote:
>
>> It's possible we'll eventually support something like this, but not
>> initially (the existing context menu code is mostly setup to display
>> static
>> contents, so there would need to be a larger refactoring to make this
>> possible).
>>
>
>  On Tue, Mar 23, 2010 at 1:23 PM, <mailto:[email protected]> wrote:
>>
>
>  >
>> > Is it possible to update the displayed 'string' in a menu item while it
>> is
>> > showing?
>>
>
>
> http://codereview.chromium.org/1042003
>

Powered by Google App Engine
This is Rietveld 408576698