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

Issue 317723005: Refactor app list ContentsView to use page indices, not show states. (Closed)

Created:
6 years, 6 months ago by Matt Giuca
Modified:
6 years, 6 months ago
Reviewers:
benwells
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, tfarina, xiyuan, calamity
Visibility:
Public.

Description

Refactor app list ContentsView to use page indices, not show states. Renamed ShowState to NamedPage. It is now an enum reserved for built-in launcher pages, for parts of the code that need hard-coded access to a specific built-in page. A mapping from named pages to page indices is provided, so pages can be accessed by named page. Not every page needs a name. Instead of remembering the current named page, it remembers the current page index (an arbitrary int). This means: - we now insert views in a sensible order for the experimental app list (and use that order for the UI), instead of hard-coding the view order the same way for both app list modes. - we will be able to dynamically add pages to the launcher. BUG=377381 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276194

Patch Set 1 #

Patch Set 2 : Formatting. #

Patch Set 3 : Rebase. #

Patch Set 4 : Roll in a second refactor: everything is now view-index-based, not show-state-based. #

Patch Set 5 : Update comments and method names. #

Patch Set 6 : Rebase off CL 312213005 (much simpler). #

Patch Set 7 : Various cleanup. #

Patch Set 8 : Reorder views; rename ShowState to NamedPage. #

Patch Set 9 : Renamed IsActiveNamedPage to IsNamedPageActive. #

Patch Set 10 : Fixed AppListViewTest. #

Total comments: 12

Patch Set 11 : Respond to review (benwells). #

Patch Set 12 : Use AddLauncherPage return value and avoid calling GetPageIndexForNamedPage. #

Patch Set 13 : Renamed again, and rewrote comments for AddLauncherPage. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -104 lines) Patch
M ui/app_list/views/app_list_main_view.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/app_list_main_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -3 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 1 chunk +9 lines, -8 lines 0 comments Download
M ui/app_list/views/contents_switcher_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +11 lines, -6 lines 0 comments Download
M ui/app_list/views/contents_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +40 lines, -15 lines 0 comments Download
M ui/app_list/views/contents_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 10 chunks +67 lines, -71 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Matt Giuca
Follow-up to https://codereview.chromium.org/312213005/.
6 years, 6 months ago (2014-06-05 06:52:16 UTC) #1
benwells
looking pretty good ... https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.cc File ui/app_list/views/contents_view.cc (right): https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.cc#newcode195 ui/app_list/views/contents_view.cc:195: view_model_->Add(view, page_index); Lines are duplicated. ...
6 years, 6 months ago (2014-06-06 06:12:29 UTC) #2
Matt Giuca
https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.cc File ui/app_list/views/contents_view.cc (right): https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.cc#newcode195 ui/app_list/views/contents_view.cc:195: view_model_->Add(view, page_index); On 2014/06/06 06:12:29, benwells wrote: > Lines ...
6 years, 6 months ago (2014-06-10 04:01:20 UTC) #3
benwells
lgtm https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.h File ui/app_list/views/contents_view.h (right): https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.h#newcode48 ui/app_list/views/contents_view.h:48: SHOW_APPS, On 2014/06/10 04:01:19, Matt Giuca wrote: > ...
6 years, 6 months ago (2014-06-10 08:06:42 UTC) #4
Matt Giuca
https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.h File ui/app_list/views/contents_view.h (right): https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.h#newcode48 ui/app_list/views/contents_view.h:48: SHOW_APPS, OK, renamed again. https://codereview.chromium.org/317723005/diff/210001/ui/app_list/views/contents_view.h#newcode101 ui/app_list/views/contents_view.h:101: void AddLauncherPage(views::View* view); ...
6 years, 6 months ago (2014-06-10 08:45:08 UTC) #5
Matt Giuca
The CQ bit was checked by mgiuca@chromium.org
6 years, 6 months ago (2014-06-10 08:50:53 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/317723005/270001
6 years, 6 months ago (2014-06-10 08:53:37 UTC) #7
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_x64_rel on tryserver.chromium ...
6 years, 6 months ago (2014-06-10 15:21:47 UTC) #8
commit-bot: I haz the power
6 years, 6 months ago (2014-06-10 23:04:51 UTC) #9
Message was sent while issue was closed.
Change committed as 276194

Powered by Google App Engine
This is Rietveld 408576698