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

Issue 508813002: Move ownership of the AppListViewDelegate into the AppListService (Closed)

Created:
6 years, 3 months ago by tapted
Modified:
6 years, 3 months ago
Reviewers:
xiyuan, James Cook
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, kalyank, sadrul, ben+ash_chromium.org, tfarina, calamity
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Move ownership of the AppListViewDelegate into the AppListService It's currently hard for the AppListService to access the model. The model is now profile keyed. However, to get the "right" profile, the AppListViewDelegate is the current source of truth. And to get this, AppListService needs to dig into its platform-specific parts to get it via the platform-specific view. However, the AppListView can be destroyed, so the delegate doesn't always exist. Therefore the AppListViewDelegate doesn't always exist -- it is created each time the AppListView is created. On ChromeOS, this is each time the app list is shown. Before the model was profile-keyed, some state was tricky to store. E.g., some is stored in ExtensionAppModelBuilder, and updated via notifications (e.g. NOTIFICATION_APP_INSTALLED_TO_APPLIST). Also, since the model must now outlive the AppListView for sync, it makes less sense for the AppListViewDelegate to be owned by the view. Currently showing the app list can create a new ALVD, which must be re-attached to the model each time. This change moves ownership of the AppListViewDelegate into the AppListServiceIpml or test/shell controllers, which will create it lazily and then cache the result. BUG=403647, 404535 Committed: https://crrev.com/537b88b13b9aa406744db1f2681ec979d593d2e8 Cr-Commit-Position: refs/heads/master@{#295646}

Patch Set 1 #

Patch Set 2 : some progress, needs test refactoring #

Patch Set 3 : remove brute-force refactoring goo, fix demo #

Patch Set 4 : disable new test on CrOS #

Patch Set 5 : rebase to master #

Total comments: 6

Patch Set 6 : fix comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -100 lines) Patch
M ash/shell/shell_delegate_impl.h View 2 chunks +2 lines, -1 line 0 comments Download
M ash/shell/shell_delegate_impl.cc View 1 2 chunks +5 lines, -2 lines 0 comments Download
M ash/shell_delegate.h View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M ash/test/test_shell_delegate.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M ash/test/test_shell_delegate.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M ash/wm/app_list_controller.cc View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_impl.h View 1 2 3 4 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_impl.cc View 1 2 3 4 3 chunks +16 lines, -3 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_impl_browsertest.cc View 1 2 3 4 3 chunks +46 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_mac.mm View 1 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_unittest.cc View 1 2 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_views.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/app_list/app_list_service_views.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_shower_delegate.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_shower_views.cc View 1 2 1 chunk +3 lines, -5 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_shower_views_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_view_delegate.h View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_view_delegate.cc View 1 2 3 4 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/ui/ash/chrome_shell_delegate.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/ash/chrome_shell_delegate.cc View 1 2 2 chunks +4 lines, -10 lines 0 comments Download
M ui/app_list/cocoa/app_list_view_controller.h View 2 chunks +3 lines, -2 lines 0 comments Download
M ui/app_list/cocoa/app_list_view_controller.mm View 3 chunks +4 lines, -4 lines 0 comments Download
M ui/app_list/cocoa/app_list_view_controller_unittest.mm View 1 chunk +9 lines, -19 lines 0 comments Download
M ui/app_list/cocoa/app_list_window_controller_unittest.mm View 1 chunk +7 lines, -8 lines 0 comments Download
M ui/app_list/demo/app_list_demo_views.cc View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M ui/app_list/views/app_list_view.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M ui/app_list/views/app_list_view.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M ui/app_list/views/app_list_view_unittest.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (10 generated)
tapted
Hi xiyuan - I think you might be the best reviewer for this, (just in ...
6 years, 3 months ago (2014-09-18 06:29:03 UTC) #9
xiyuan
lgtm
6 years, 3 months ago (2014-09-18 19:48:40 UTC) #10
tapted
+ jamescook could you please review for OWNERS in src/ash and c/b/ui/ash
6 years, 3 months ago (2014-09-18 23:10:25 UTC) #12
James Cook
ash LGTM with nits https://codereview.chromium.org/508813002/diff/220001/ash/shell_delegate.h File ash/shell_delegate.h (right): https://codereview.chromium.org/508813002/diff/220001/ash/shell_delegate.h#newcode114 ash/shell_delegate.h:114: // Invoked to create an ...
6 years, 3 months ago (2014-09-18 23:29:56 UTC) #13
tapted
Thanks all! https://codereview.chromium.org/508813002/diff/220001/ash/shell_delegate.h File ash/shell_delegate.h (right): https://codereview.chromium.org/508813002/diff/220001/ash/shell_delegate.h#newcode114 ash/shell_delegate.h:114: // Invoked to create an AppListViewDelegate. Shell ...
6 years, 3 months ago (2014-09-19 00:49:01 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/508813002/240001
6 years, 3 months ago (2014-09-19 01:52:24 UTC) #16
commit-bot: I haz the power
Committed patchset #6 (id:240001) as 5080ffa167d3a4fb76273abeea84d73eb831d90d
6 years, 3 months ago (2014-09-19 02:49:20 UTC) #17
commit-bot: I haz the power
6 years, 3 months ago (2014-09-19 02:50:19 UTC) #18
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/537b88b13b9aa406744db1f2681ec979d593d2e8
Cr-Commit-Position: refs/heads/master@{#295646}

Powered by Google App Engine
This is Rietveld 408576698