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

Issue 2671923002: mash: Cleanup ash shelf application menu code. (Closed)

Created:
3 years, 10 months ago by msw
Modified:
3 years, 10 months ago
Reviewers:
James Cook
CC:
chromium-reviews, kalyank, sadrul, extensions-reviews_chromium.org, chromium-apps-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

mash: Cleanup ash shelf application menu code. Make chrome push menu state into ash, avoid some ash->chrome delegation. Make ShelfItemDelegate supply a list of app menu items, not a menu model. Make ShelfView construct the menu model, not chrome shelf item delegates. Make ShelfView supply the app name (shelf item title), not each item delegate. Nix redundant LauncherItemController::GetApplicationList, inclusion of app title item. Nix app menu item support for leading separators and IsEnabled() (for app titles). (ShelfView gets the app title from the shelf item when constructing the menu) Move the item & model classes to ash (item is public, model is 'internal') Lots of simplification, refactoring, test updates, and cleanup. TODO: Generalize mojom::ContextMenuItem and eliminate this app menu item. TODO: Generalize mojom::ShelfItemDelegate::ExecuteCommand for app menu items. BUG=557406 TEST=Automated; no behavior change for menus shown when clicking shelf items with multiple open windows. R=jamescook@chromium.org Review-Url: https://codereview.chromium.org/2671923002 Cr-Commit-Position: refs/heads/master@{#448692} Committed: https://chromium.googlesource.com/chromium/src/+/84352d5d869c9c5a8092f4dc44dab7a6950a3b18

Patch Set 1 #

Patch Set 2 : Working on it #

Patch Set 3 : Seems to work, tests need fixing. #

Patch Set 4 : Fix tests; cleanup. #

Total comments: 51

Patch Set 5 : Address comments. #

Total comments: 2

Patch Set 6 : Add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+579 lines, -946 lines) Patch
M ash/BUILD.gn View 1 2 chunks +3 lines, -0 lines 0 comments Download
M ash/common/shelf/app_list_shelf_item_delegate.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ash/common/shelf/app_list_shelf_item_delegate.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
A ash/common/shelf/shelf_application_menu_model.h View 1 2 3 4 1 chunk +58 lines, -0 lines 0 comments Download
A ash/common/shelf/shelf_application_menu_model.cc View 1 2 3 4 5 1 chunk +69 lines, -0 lines 0 comments Download
A ash/common/shelf/shelf_application_menu_model_unittest.cc View 1 2 3 4 1 chunk +130 lines, -0 lines 0 comments Download
M ash/common/shelf/shelf_controller.cc View 1 2 3 4 2 chunks +7 lines, -32 lines 0 comments Download
M ash/common/shelf/shelf_item_delegate.h View 1 2 3 4 2 chunks +3 lines, -11 lines 0 comments Download
M ash/common/shelf/shelf_view.cc View 1 2 3 4 3 chunks +12 lines, -7 lines 0 comments Download
M ash/common/shelf/shelf_window_watcher_item_delegate.h View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M ash/common/shelf/shelf_window_watcher_item_delegate.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M ash/common/test/test_shelf_item_delegate.h View 1 2 3 4 2 chunks +1 line, -2 lines 0 comments Download
M ash/common/test/test_shelf_item_delegate.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M ash/public/cpp/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
A ash/public/cpp/shelf_application_menu_item.h View 1 2 3 4 1 chunk +46 lines, -0 lines 0 comments Download
A ash/public/cpp/shelf_application_menu_item.cc View 1 1 chunk +17 lines, -0 lines 0 comments Download
M ash/shelf/shelf_view_unittest.cc View 1 2 3 4 2 chunks +6 lines, -32 lines 0 comments Download
M ash/shell/window_watcher_shelf_item_delegate.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ash/shell/window_watcher_shelf_item_delegate.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/BUILD.gn View 1 2 chunks +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc View 1 2 3 4 4 chunks +24 lines, -40 lines 0 comments Download
M chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc View 1 2 3 4 4 chunks +23 lines, -35 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controller.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controller.cc View 1 2 3 4 2 chunks +3 lines, -8 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc View 1 2 3 4 3 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc View 1 2 3 4 5 chunks +23 lines, -36 lines 0 comments Download
D chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h View 1 chunk +0 lines, -49 lines 0 comments Download
D chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.cc View 1 chunk +0 lines, -20 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h View 1 2 3 4 1 chunk +6 lines, -10 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc View 1 2 3 2 chunks +2 lines, -8 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h View 1 chunk +7 lines, -10 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc View 1 chunk +3 lines, -9 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h View 1 chunk +9 lines, -13 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.cc View 1 chunk +4 lines, -11 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller.h View 1 2 3 4 3 chunks +3 lines, -8 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc View 1 2 3 4 4 chunks +13 lines, -34 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc View 1 2 3 4 17 chunks +55 lines, -125 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc View 1 2 3 4 3 chunks +15 lines, -18 lines 0 comments Download
D chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h View 1 chunk +0 lines, -53 lines 0 comments Download
D chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.cc View 1 chunk +0 lines, -86 lines 0 comments Download
D chrome/browser/ui/ash/launcher/launcher_application_menu_item_model_unittest.cc View 1 chunk +0 lines, -109 lines 0 comments Download
M chrome/browser/ui/ash/launcher/launcher_item_controller.h View 1 2 chunks +0 lines, -7 lines 0 comments Download
D chrome/browser/ui/ash/launcher/test/launcher_application_menu_item_model_test_api.h View 1 chunk +0 lines, -36 lines 0 comments Download
D chrome/browser/ui/ash/launcher/test/launcher_application_menu_item_model_test_api.cc View 1 chunk +0 lines, -26 lines 0 comments Download
M chrome/browser/ui/ash/launcher/test/test_chrome_launcher_app_menu_item.h View 1 1 chunk +0 lines, -35 lines 0 comments Download
M chrome/browser/ui/ash/launcher/test/test_chrome_launcher_app_menu_item.cc View 1 1 chunk +0 lines, -22 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 chunks +0 lines, -10 lines 0 comments Download

Messages

Total messages: 23 (16 generated)
msw
Hey James, please take a look, thanks!
3 years, 10 months ago (2017-02-06 15:04:44 UTC) #9
James Cook
Overall approach looks good. I really like how you separated out the data model (the ...
3 years, 10 months ago (2017-02-06 17:30:22 UTC) #10
msw
Comments addressed. Please take another look, thanks! https://codereview.chromium.org/2671923002/diff/80001/ash/common/shelf/shelf_application_menu_model.cc File ash/common/shelf/shelf_application_menu_model.cc (right): https://codereview.chromium.org/2671923002/diff/80001/ash/common/shelf/shelf_application_menu_model.cc#newcode16 ash/common/shelf/shelf_application_menu_model.cc:16: const int ...
3 years, 10 months ago (2017-02-07 09:12:02 UTC) #13
James Cook
LGTM. Nice patch. https://codereview.chromium.org/2671923002/diff/80001/ash/common/shelf/shelf_application_menu_model.cc File ash/common/shelf/shelf_application_menu_model.cc (right): https://codereview.chromium.org/2671923002/diff/80001/ash/common/shelf/shelf_application_menu_model.cc#newcode16 ash/common/shelf/shelf_application_menu_model.cc:16: const int kInvalidCommandId = std::numeric_limits<int>::max(); On ...
3 years, 10 months ago (2017-02-07 16:32:24 UTC) #16
msw
Comments addressed; thanks! https://codereview.chromium.org/2671923002/diff/80001/ash/common/shelf/shelf_application_menu_model.cc File ash/common/shelf/shelf_application_menu_model.cc (right): https://codereview.chromium.org/2671923002/diff/80001/ash/common/shelf/shelf_application_menu_model.cc#newcode32 ash/common/shelf/shelf_application_menu_model.cc:32: AddSeparator(ui::SPACING_SEPARATOR); On 2017/02/07 16:32:24, James Cook ...
3 years, 10 months ago (2017-02-07 18:19:15 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2671923002/120001
3 years, 10 months ago (2017-02-07 18:19:48 UTC) #20
commit-bot: I haz the power
3 years, 10 months ago (2017-02-07 19:27:52 UTC) #23
Message was sent while issue was closed.
Committed patchset #6 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/84352d5d869c9c5a8092f4dc44da...

Powered by Google App Engine
This is Rietveld 408576698