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

Issue 2833173002: mash: Support ShelfModel access in Chrome. (Closed)

Created:
3 years, 8 months ago by msw
Modified:
3 years, 6 months ago
Reviewers:
Tom Sepez, James Cook, sky
CC:
chromium-reviews, sadrul, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, kalyank, darin (slow to review), sky
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

mash: Support ShelfModel access in Chrome. Sync ShelfModels between ShelfController and ChromeLauncherController. (allows synchronous access to ShelfModel/ShelfItem in Ash and Chrome) This brings us much closer to a functional Shelf in Mash. Implements step (2Bd) of my Mash Shelf Model and Control plan: docs.google.com/document/d/1wD0W2VKAEyeslXxc4L-QpOxZlIyaSZ74oSMndmrF120 Extend ShelfController interface to support ShelfModel modifications. Extend ShelfObserver interface to report ShelfModel modifications. Add/restore old ash::ShelfModelObserver::ShelfItemDelegateChanged. Make mojom::ShelfItem::image optional (for tests and async load). Make ShelfController and ChromeLauncherController observe and sync. Avoid cyclically reporting remote changes with a flag. Add RemoteShelfItemDelegate; to delegate between Ash and Chrome. (allows ShelfModel to own/use ash::ShelfItemDelegate instances) Add a binding and helper function on ash::ShelfItemDelegate. Remove Mash's workaround code in ShelfWindowWatcher. Remove unused/deprecated ash::mojom::ShelfController functions. Add AppList item in model ctor and its delegate in controller ctor. (avoids item ordering problems on init, Ash owns item delegate) Add missing type mapping for ash::ShelfID and ash.mojom.ShelfID. Add a stream output operator for ShelfID testing/logging. Change chromeos::GetAshConfig to support --mash and --mus flags. (This allows unit_tests to run in simulated mus/mash configs). Add and update shelf controller, model, and CLC tests. Replace a CLC panel test with ShelfWindowWatcherTest.ItemIcon. TODO: Fix context menus, AppList's PinToShelf, etc. TODO: Ensure that windows like QuickLaunch get shelf items. BUG=557406 TEST=No Chrome OS changes; mash shelf shows pinned items, etc. R=jamescook@chromium.org,sky@chromium.org,tsepez@chromium.org, Review-Url: https://codereview.chromium.org/2833173002 Cr-Commit-Position: refs/heads/master@{#476166} Committed: https://chromium.googlesource.com/chromium/src/+/19b30c2c383d894f472343c308f1e2f71b98a790

Patch Set 1 #

Patch Set 2 : Icons show! #

Patch Set 3 : Add and begin supporting RemoteShelfItemDelegate. #

Patch Set 4 : Refine behavior add Chrome-side unit_test. #

Patch Set 5 : Add a browser test and ShelfController unit tests. #

Patch Set 6 : Sync and rebase. #

Patch Set 7 : Cleanup; Fix an Arc test by use CLC, not Ash's ShelfModel. #

Total comments: 2

Patch Set 8 : Pursuing Scott's suggestions. #

Patch Set 9 : Relax ShelfController params. TODO: Fix pin order. #

Patch Set 10 : Sync and rebase. #

Patch Set 11 : Refine init pattern; add AppList item in ShelfModel ctor. #

Total comments: 28

Patch Set 12 : Address comments. #

Patch Set 13 : Sync and rebase. #

Total comments: 6

Patch Set 14 : Address comments; fix test failures. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1017 lines, -389 lines) Patch
M ash/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M ash/public/cpp/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A ash/public/cpp/remote_shelf_item_delegate.h View 1 2 3 4 5 6 1 chunk +37 lines, -0 lines 2 comments Download
A ash/public/cpp/remote_shelf_item_delegate.cc View 1 2 3 4 5 6 1 chunk +33 lines, -0 lines 0 comments Download
M ash/public/cpp/shelf_item_delegate.h View 1 2 3 chunks +7 lines, -0 lines 0 comments Download
M ash/public/cpp/shelf_item_delegate.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M ash/public/cpp/shelf_types.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ash/public/cpp/shelf_types.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ash/public/interfaces/shelf.mojom View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +39 lines, -13 lines 0 comments Download
M ash/public/interfaces/shelf.typemap View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ash/shelf/app_list_shelf_item_delegate.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -5 lines 0 comments Download
M ash/shelf/app_list_shelf_item_delegate.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -27 lines 0 comments Download
M ash/shelf/shelf_controller.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +25 lines, -12 lines 0 comments Download
M ash/shelf/shelf_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +146 lines, -13 lines 0 comments Download
A ash/shelf/shelf_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +192 lines, -0 lines 0 comments Download
M ash/shelf/shelf_model.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -2 lines 0 comments Download
M ash/shelf/shelf_model.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +19 lines, -3 lines 0 comments Download
M ash/shelf/shelf_model_observer.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -0 lines 0 comments Download
M ash/shelf/shelf_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +9 lines, -10 lines 0 comments Download
M ash/shelf/shelf_view.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M ash/shelf/shelf_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +18 lines, -2 lines 0 comments Download
M ash/shelf/shelf_window_watcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +4 lines, -43 lines 0 comments Download
M ash/shelf/shelf_window_watcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +46 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc View 1 2 3 4 5 6 4 chunks +4 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/ash_config.cc View 1 2 3 4 5 6 1 chunk +20 lines, -7 lines 0 comments Download
M chrome/browser/ui/ash/app_list/app_list_controller_ash.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +18 lines, -0 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +120 lines, -4 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 55 chunks +238 lines, -233 lines 0 comments Download
M chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 69 (53 generated)
msw
Hey James, please take a look if you're feeling well enough; thanks! I could split ...
3 years, 6 months ago (2017-05-26 06:30:02 UTC) #13
sky
I started on this, and have a question about the design choice you made. Happy ...
3 years, 6 months ago (2017-05-26 19:42:01 UTC) #15
msw
Thanks for the feedback; work in progress. I'll ping back next week. https://codereview.chromium.org/2833173002/diff/180001/ash/public/interfaces/shelf.mojom File ash/public/interfaces/shelf.mojom ...
3 years, 6 months ago (2017-05-27 00:04:39 UTC) #18
James Cook
msw, I can take over this review. Ping me when you want me to look.
3 years, 6 months ago (2017-05-30 15:00:10 UTC) #21
msw
James, please take a look; thanks!
3 years, 6 months ago (2017-05-30 21:47:06 UTC) #29
James Cook
Approach looks good. https://codereview.chromium.org/2833173002/diff/260001/ash/public/interfaces/shelf.mojom File ash/public/interfaces/shelf.mojom (right): https://codereview.chromium.org/2833173002/diff/260001/ash/public/interfaces/shelf.mojom#newcode69 ash/public/interfaces/shelf.mojom:69: MoveShelfItem(ShelfID id, int32 target_index); nit: document ...
3 years, 6 months ago (2017-05-30 22:47:48 UTC) #34
sky
Thanks for adding explicit mutation functions and having the observer only in one direction. Much ...
3 years, 6 months ago (2017-05-30 23:21:56 UTC) #37
msw
Comments addressed. Please take another look, thanks! https://codereview.chromium.org/2833173002/diff/260001/ash/public/interfaces/shelf.mojom File ash/public/interfaces/shelf.mojom (right): https://codereview.chromium.org/2833173002/diff/260001/ash/public/interfaces/shelf.mojom#newcode69 ash/public/interfaces/shelf.mojom:69: MoveShelfItem(ShelfID id, ...
3 years, 6 months ago (2017-05-31 16:55:22 UTC) #41
James Cook
LGTM with nits. Epic CL. https://codereview.chromium.org/2833173002/diff/320001/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc File chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc (right): https://codereview.chromium.org/2833173002/diff/320001/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc#newcode1287 chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc:1287: DCHECK_LE(index, model_->item_count()) << "Index ...
3 years, 6 months ago (2017-05-31 20:02:31 UTC) #48
msw
Tom, please review ash/public/interfaces/* Scott, please review chrome/browser/chromeos/* (we discussed ash_config.cc offline last week, the ...
3 years, 6 months ago (2017-05-31 20:32:26 UTC) #51
Tom Sepez
https://codereview.chromium.org/2833173002/diff/340001/ash/public/cpp/remote_shelf_item_delegate.h File ash/public/cpp/remote_shelf_item_delegate.h (right): https://codereview.chromium.org/2833173002/diff/340001/ash/public/cpp/remote_shelf_item_delegate.h#newcode14 ash/public/cpp/remote_shelf_item_delegate.h:14: class ASH_PUBLIC_EXPORT RemoteShelfItemDelegate : public ShelfItemDelegate { This is ...
3 years, 6 months ago (2017-05-31 21:14:27 UTC) #54
msw
https://codereview.chromium.org/2833173002/diff/340001/ash/public/cpp/remote_shelf_item_delegate.h File ash/public/cpp/remote_shelf_item_delegate.h (right): https://codereview.chromium.org/2833173002/diff/340001/ash/public/cpp/remote_shelf_item_delegate.h#newcode14 ash/public/cpp/remote_shelf_item_delegate.h:14: class ASH_PUBLIC_EXPORT RemoteShelfItemDelegate : public ShelfItemDelegate { On 2017/05/31 ...
3 years, 6 months ago (2017-05-31 21:36:55 UTC) #55
Tom Sepez
lgtm
3 years, 6 months ago (2017-05-31 22:38:52 UTC) #58
sky
LGTM
3 years, 6 months ago (2017-06-01 02:55:47 UTC) #61
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/2833173002/340001
3 years, 6 months ago (2017-06-01 03:16:47 UTC) #66
commit-bot: I haz the power
3 years, 6 months ago (2017-06-01 03:21:57 UTC) #69
Message was sent while issue was closed.
Committed patchset #14 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/19b30c2c383d894f472343c308f1...

Powered by Google App Engine
This is Rietveld 408576698