Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Issue 169093009: Separate out logic to handle different category/group of context menu items from RVContextMenu class (Closed)

Created:
6 years, 10 months ago by lazyboy
Modified:
6 years, 9 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, creis+watch_chromium.org, extensions-reviews_chromium.org, ajwong+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@work-mmm-refactor1
Visibility:
Public.

Description

Separate out logic to handle different category/group of context menu items from RVContextMenu class. This is separated into classes ContextMenuContentType*. This way, we have separate ContextMenuContentType* classes for regular pages (ContextMenuContentType), platform_app (ContextMenuContentTypePlatformApp), extension_popup (ContextMenuContentTypeExtensionPopup), panel (ContextMenuContentTypePanel), app_mode (ContextMenuContentMenuContentTypeAppMode) and <webview> guest (ContetMenuContentTypeWebView). The motivation is to separate out the logic to decide what category/group to show for <webview> guest from RVContextMenu independently. This will also stop cluttering RVContextMenu with is_guest_ checks. Webview ContextMenu API would benefit from this. Unrelated, but docs can be found for Webview ContextMenu API can be found here: https://docs.google.com/a/chromium.org/document/d/1AoMD6kF8ui1dikzTrwK-weVHegSqQaLV2zx4xJSh_fQ/edit and https://docs.google.com/a/chromium.org/document/d/11pE2PRGSyLbZGVVP1pspViK_xLWv_A-1dJDY2kjjbgc/edit BUG=140315 Test=No behavioral change expected, internal refactor. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=254287

Patch Set 1 #

Patch Set 2 : Rename some files + lint cleanup. #

Patch Set 3 : Add some comments. #

Patch Set 4 : rebase + add some doc. #

Patch Set 5 : fix incorrect dcheck + platform app logic #

Total comments: 20

Patch Set 6 : Rename MenuCategoryX -> MenuContextX, drop Base suffix, remove bitmask, overall rename Category->Group #

Patch Set 7 : Move files under tab_contents/menu_context/*, rename files. #

Patch Set 8 : Move webview specific file under c/b/guestview/webview/* #

Total comments: 3

Patch Set 9 : Address comments. #

Patch Set 10 : Move new files under c/b/context_menu #

Patch Set 11 : rebase @tott, whitespace change. #

Patch Set 12 : Forgot to add context_menu_content_type_webview.* #

Total comments: 2

Patch Set 13 : Update OWNERS #

Patch Set 14 : rename: context_menu/->renderer_context_menu/ as we renamed in http://crrev.com/178193005 #

Patch Set 15 : rebase @tott #

Patch Set 16 : Fix custom item logic + separator. #

Patch Set 17 : Fix extension items adding. #

Patch Set 18 : fix semicolon #

Unified diffs Side-by-side diffs Delta from patch set Stats (+781 lines, -190 lines) Patch
A chrome/browser/guestview/webview/context_menu_content_type_webview.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +31 lines, -0 lines 0 comments Download
A chrome/browser/guestview/webview/context_menu_content_type_webview.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +30 lines, -0 lines 0 comments Download
A + chrome/browser/renderer_context_menu/OWNERS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +86 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +180 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_app_mode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +27 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_app_mode.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +24 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_extension_popup.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_extension_popup.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +31 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_panel.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +27 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_panel.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +27 lines, -0 lines 0 comments Download
A chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +46 lines, -0 lines 0 comments Download
M chrome/browser/renderer_context_menu/render_view_context_menu.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +7 lines, -10 lines 0 comments Download
M chrome/browser/renderer_context_menu/render_view_context_menu.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +113 lines, -180 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
lazyboy
Hi Avi, Please take a look at RenderViewContextMenu::InitMenu() to see if this change makes sense. ...
6 years, 10 months ago (2014-02-22 00:17:24 UTC) #1
Avi (use Gerrit)
On 2014/02/22 00:17:24, lazyboy wrote: > Hi Avi, Please take a look at RenderViewContextMenu::InitMenu() to ...
6 years, 10 months ago (2014-02-22 01:28:16 UTC) #2
Avi (use Gerrit)
I like that you're attacking this for cleanup. I'm not thrilled with this answer but ...
6 years, 10 months ago (2014-02-22 01:37:44 UTC) #3
Fady Samuel
Some initial set of comments. https://codereview.chromium.org/169093009/diff/240001/chrome/browser/tab_contents/menu_category_base.cc File chrome/browser/tab_contents/menu_category_base.cc (right): https://codereview.chromium.org/169093009/diff/240001/chrome/browser/tab_contents/menu_category_base.cc#newcode75 chrome/browser/tab_contents/menu_category_base.cc:75: int MenuCategoryBase::GetCategories() { GetSupportedCategories ...
6 years, 10 months ago (2014-02-24 19:07:28 UTC) #4
lazyboy
Avi: I've moved the files under c/b/tab_contents/menu_context/*. Files are renamed based on review comments from ...
6 years, 10 months ago (2014-02-24 23:45:00 UTC) #5
Fady Samuel
LGTM with nits. https://codereview.chromium.org/169093009/diff/410001/chrome/browser/guestview/webview/menu_context_guest.cc File chrome/browser/guestview/webview/menu_context_guest.cc (right): https://codereview.chromium.org/169093009/diff/410001/chrome/browser/guestview/webview/menu_context_guest.cc#newcode7 chrome/browser/guestview/webview/menu_context_guest.cc:7: MenuContextGuest::MenuContextGuest(content::RenderFrameHost* render_frame_host, Can we call this ...
6 years, 10 months ago (2014-02-25 00:33:53 UTC) #6
lazyboy
render_view_context_menu.cc change seems like git cl upload issue, should be fixed in latest upload. https://codereview.chromium.org/169093009/diff/410001/chrome/browser/guestview/webview/menu_context_guest.cc ...
6 years, 10 months ago (2014-02-25 01:29:08 UTC) #7
Avi (use Gerrit)
On 2014/02/24 23:45:00, lazyboy wrote: > Avi: I've moved the files under c/b/tab_contents/menu_context/*. :/ I'm ...
6 years, 10 months ago (2014-02-25 03:52:16 UTC) #8
lazyboy
On 2014/02/25 03:52:16, Avi wrote: > On 2014/02/24 23:45:00, lazyboy wrote: > > Avi: I've ...
6 years, 10 months ago (2014-02-25 04:12:42 UTC) #9
Avi (use Gerrit)
On 2014/02/25 04:12:42, lazyboy wrote: > On 2014/02/25 03:52:16, Avi wrote: > > On 2014/02/24 ...
6 years, 10 months ago (2014-02-25 04:27:30 UTC) #10
Fady Samuel
On 2014/02/25 04:27:30, Avi wrote: > On 2014/02/25 04:12:42, lazyboy wrote: > > On 2014/02/25 ...
6 years, 10 months ago (2014-02-25 16:55:27 UTC) #11
Avi (use Gerrit)
On 2014/02/25 16:55:27, Fady Samuel wrote: > On 2014/02/25 04:27:30, Avi wrote: > > On ...
6 years, 10 months ago (2014-02-25 17:20:41 UTC) #12
Fady Samuel
On 2014/02/25 17:20:41, Avi wrote: > On 2014/02/25 16:55:27, Fady Samuel wrote: > > On ...
6 years, 10 months ago (2014-02-25 18:21:26 UTC) #13
Avi (use Gerrit)
On 2014/02/25 18:21:26, Fady Samuel wrote: > On 2014/02/25 17:20:41, Avi wrote: > > On ...
6 years, 10 months ago (2014-02-25 18:49:02 UTC) #14
lazyboy
On 2014/02/25 18:49:02, Avi wrote: > On 2014/02/25 18:21:26, Fady Samuel wrote: > > On ...
6 years, 10 months ago (2014-02-25 18:56:05 UTC) #15
Avi (use Gerrit)
On 2014/02/25 18:56:05, lazyboy wrote: > On 2014/02/25 18:49:02, Avi wrote: > > On 2014/02/25 ...
6 years, 10 months ago (2014-02-25 19:01:25 UTC) #16
lazyboy
I've moved files under c/b/context_menu/* and renamed them to ContextMenuContentTypeX, Avi/Fady PTAL.
6 years, 10 months ago (2014-02-25 20:49:08 UTC) #17
Fady Samuel
lgtm
6 years, 10 months ago (2014-02-26 17:49:33 UTC) #18
Avi (use Gerrit)
LGTM https://codereview.chromium.org/169093009/diff/490001/chrome/browser/context_menu/OWNERS File chrome/browser/context_menu/OWNERS (right): https://codereview.chromium.org/169093009/diff/490001/chrome/browser/context_menu/OWNERS#newcode2 chrome/browser/context_menu/OWNERS:2: brettw@chromium.org What? Not you? :)
6 years, 10 months ago (2014-02-26 17:55:50 UTC) #19
lazyboy
Looks like we are going to rename the directory to renderer_context_menu/ (crrev.com/178193005), I'll wait to ...
6 years, 10 months ago (2014-02-26 19:55:11 UTC) #20
lazyboy
The CQ bit was checked by lazyboy@chromium.org
6 years, 9 months ago (2014-02-28 19:45:09 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lazyboy@chromium.org/169093009/590001
6 years, 9 months ago (2014-02-28 19:49:45 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-02-28 20:42:39 UTC) #23
commit-bot: I haz the power
Retried try job too often on android_dbg for step(s) slave_steps http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=android_dbg&number=155680
6 years, 9 months ago (2014-02-28 20:42:40 UTC) #24
lazyboy
The CQ bit was checked by lazyboy@chromium.org
6 years, 9 months ago (2014-02-28 20:54:36 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lazyboy@chromium.org/169093009/610001
6 years, 9 months ago (2014-02-28 20:55:28 UTC) #26
commit-bot: I haz the power
6 years, 9 months ago (2014-03-01 00:22:46 UTC) #27
Message was sent while issue was closed.
Change committed as 254287

Powered by Google App Engine
This is Rietveld 408576698