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

Issue 302803002: Refactor app list so AppsGridView owns the PaginationModel. (Closed)

Created:
6 years, 6 months ago by Matt Giuca
Modified:
6 years, 6 months ago
Reviewers:
tapted, pkotwicz, xiyuan
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, kalyank, sadrul, ben+ash_chromium.org, tfarina, benwells, xiyuan, calamity, Jun Mukai
Visibility:
Public.

Description

Refactor app list so AppsGridView owns the PaginationModel. Previously, PaginationModel was created by platform-specific code (either AppListController or AppListShower) and passed down through 6 layers to AppsGridView. Now, AppsGridView creates its own PaginationModel, and many of the layers don't need to know about it. Some classes do need to access the PaginationModel (most of these dependencies can probably be broken later). These now pull the PaginationModel from the AppsGridView instead of caching it on the way down. On ChromeOS, the lifetime of the PaginationModel is now tied to the visibility of the app list (was previously the lifetime of the process). To get around this, AppListController must now manually remember the current page, passing it to new PaginationModels as they are created, as well as adding itself as an observer. This is still a net win, as the ownership is in the right place, and several classes no longer depend on PaginationModel, with more dependency cuts possible in the future. BUG=377626 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=274785

Patch Set 1 #

Patch Set 2 : Rebase. #

Patch Set 3 : Fix tests and bugs. #

Total comments: 42

Patch Set 4 : Fixed app_list_demo. #

Patch Set 5 : Respond to review comments (tapted and xiyuan). #

Total comments: 6

Patch Set 6 : Various improvements. #

Patch Set 7 : Pass initial page number to AppListMainView to preload the correct page. #

Patch Set 8 : Renamed current_app_page to current_apps_page. #

Patch Set 9 : Rebase against CL 311753002 (precursor). #

Patch Set 10 : Fix AppListDemo. #

Patch Set 11 : Run ClangFormat (corrects pre-existing issues). #

Patch Set 12 : AppsGridView: Initialize PageSwitcher in the body of the constructor. #

Patch Set 13 : Rebase. #

Patch Set 14 : Fix compile error (conflict). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+193 lines, -172 lines) Patch
M ash/wm/app_list_controller.h View 1 2 3 4 5 6 7 3 chunks +4 lines, -3 lines 0 comments Download
M ash/wm/app_list_controller.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +28 lines, -20 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_shower_views.h View 1 2 3 4 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_shower_views.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/app_list_demo.cc View 1 2 3 4 5 6 7 8 9 3 chunks +1 line, -3 lines 0 comments Download
M ui/app_list/views/app_list_folder_view.h View 1 2 chunks +0 lines, -3 lines 0 comments Download
M ui/app_list/views/app_list_folder_view.cc View 1 3 chunks +1 line, -6 lines 0 comments Download
M ui/app_list/views/app_list_main_view.h View 1 2 3 4 5 6 3 chunks +4 lines, -2 lines 0 comments Download
M ui/app_list/views/app_list_main_view.cc View 1 2 3 4 5 6 7 8 4 chunks +16 lines, -7 lines 0 comments Download
M ui/app_list/views/app_list_main_view_unittest.cc View 1 2 3 4 5 6 3 chunks +1 line, -4 lines 0 comments Download
M ui/app_list/views/app_list_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -3 lines 0 comments Download
M ui/app_list/views/app_list_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +14 lines, -9 lines 0 comments Download
M ui/app_list/views/app_list_view_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +18 lines, -12 lines 0 comments Download
M ui/app_list/views/apps_container_view.h View 1 2 chunks +0 lines, -2 lines 0 comments Download
M ui/app_list/views/apps_container_view.cc View 1 2 chunks +1 line, -3 lines 0 comments Download
M ui/app_list/views/apps_grid_view.h View 1 2 3 4 5 6 7 8 4 chunks +8 lines, -5 lines 0 comments Download
M ui/app_list/views/apps_grid_view.cc View 1 2 3 4 5 6 7 8 9 10 11 24 chunks +42 lines, -38 lines 0 comments Download
M ui/app_list/views/apps_grid_view_unittest.cc View 1 2 3 4 5 8 chunks +24 lines, -23 lines 0 comments Download
M ui/app_list/views/contents_view.h View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M ui/app_list/views/contents_view.cc View 1 2 3 4 6 chunks +20 lines, -23 lines 0 comments Download
M ui/app_list/views/page_switcher.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 24 (0 generated)
Matt Giuca
Hi, this is a reasonably annoying refactor because it introduces a bit of extra mess ...
6 years, 6 months ago (2014-05-30 09:08:28 UTC) #1
xiyuan
Good change to move PaginationModel into views. https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc#newcode106 ui/app_list/views/app_list_main_view.cc:106: ->GetPaginationModel(); Can ...
6 years, 6 months ago (2014-05-30 15:47:47 UTC) #2
tapted
https://codereview.chromium.org/302803002/diff/40001/ash/wm/app_list_controller.cc File ash/wm/app_list_controller.cc (right): https://codereview.chromium.org/302803002/diff/40001/ash/wm/app_list_controller.cc#newcode288 ash/wm/app_list_controller.cc:288: pagination_model_ = view_->app_list_main_view() I think this justifies a GetPaginationModel() ...
6 years, 6 months ago (2014-06-02 04:02:20 UTC) #3
Matt Giuca
https://codereview.chromium.org/302803002/diff/40001/ash/wm/app_list_controller.cc File ash/wm/app_list_controller.cc (right): https://codereview.chromium.org/302803002/diff/40001/ash/wm/app_list_controller.cc#newcode288 ash/wm/app_list_controller.cc:288: pagination_model_ = view_->app_list_main_view() Done & Done. https://codereview.chromium.org/302803002/diff/40001/chrome/browser/ui/app_list/app_list_shower_views.h File chrome/browser/ui/app_list/app_list_shower_views.h ...
6 years, 6 months ago (2014-06-02 07:11:23 UTC) #4
tapted
https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc#newcode204 ui/app_list/views/app_list_main_view.cc:204: const int selected_page = std::max(0, pagination_model_->selected_page()); On 2014/06/02 07:11:23, ...
6 years, 6 months ago (2014-06-02 08:36:48 UTC) #5
xiyuan
https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc#newcode204 ui/app_list/views/app_list_main_view.cc:204: const int selected_page = std::max(0, pagination_model_->selected_page()); I would object ...
6 years, 6 months ago (2014-06-02 17:02:08 UTC) #6
Matt Giuca
https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc#newcode204 ui/app_list/views/app_list_main_view.cc:204: const int selected_page = std::max(0, pagination_model_->selected_page()); Had a chat ...
6 years, 6 months ago (2014-06-03 01:52:36 UTC) #7
Matt Giuca
https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc#newcode204 ui/app_list/views/app_list_main_view.cc:204: const int selected_page = std::max(0, pagination_model_->selected_page()); Actually, it isn't ...
6 years, 6 months ago (2014-06-03 03:58:26 UTC) #8
xiyuan
LGTM! https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc#newcode204 ui/app_list/views/app_list_main_view.cc:204: const int selected_page = std::max(0, pagination_model_->selected_page()); On 2014/06/03 ...
6 years, 6 months ago (2014-06-03 04:10:34 UTC) #9
tapted
nice! lgtm
6 years, 6 months ago (2014-06-03 06:33:46 UTC) #10
Matt Giuca
pkotwicz: PTAL at the app_list_controller. Should be fairly stable now. Thanks. https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): ...
6 years, 6 months ago (2014-06-03 06:51:42 UTC) #11
pkotwicz
LGTM
6 years, 6 months ago (2014-06-03 15:55:56 UTC) #12
xiyuan
https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc File ui/app_list/views/app_list_main_view.cc (right): https://codereview.chromium.org/302803002/diff/40001/ui/app_list/views/app_list_main_view.cc#newcode204 ui/app_list/views/app_list_main_view.cc:204: const int selected_page = std::max(0, pagination_model_->selected_page()); On 2014/06/03 06:51:43, ...
6 years, 6 months ago (2014-06-03 16:10:34 UTC) #13
Matt Giuca
The CQ bit was checked by mgiuca@chromium.org
6 years, 6 months ago (2014-06-04 01:36:07 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/302803002/200001
6 years, 6 months ago (2014-06-04 01:36:42 UTC) #15
Matt Giuca
The CQ bit was unchecked by mgiuca@chromium.org
6 years, 6 months ago (2014-06-04 01:36:47 UTC) #16
Matt Giuca
The CQ bit was checked by mgiuca@chromium.org
6 years, 6 months ago (2014-06-04 01:38:16 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/302803002/200001
6 years, 6 months ago (2014-06-04 01:38:38 UTC) #18
Matt Giuca
The CQ bit was checked by mgiuca@chromium.org
6 years, 6 months ago (2014-06-04 01:54:06 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/302803002/220001
6 years, 6 months ago (2014-06-04 01:55:54 UTC) #20
Matt Giuca
The CQ bit was checked by mgiuca@chromium.org
6 years, 6 months ago (2014-06-04 03:52:57 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/302803002/240001
6 years, 6 months ago (2014-06-04 03:53:54 UTC) #22
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_rel on tryserver.chromium ...
6 years, 6 months ago (2014-06-04 07:05:23 UTC) #23
commit-bot: I haz the power
6 years, 6 months ago (2014-06-04 12:23:48 UTC) #24
Message was sent while issue was closed.
Change committed as 274785

Powered by Google App Engine
This is Rietveld 408576698