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

Side by Side Diff: ui/app_list/views/start_page_view.cc

Issue 947903002: Change ContentsView::SetActivePage to use States rather than indexes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/app_list/views/start_page_view.h" 5 #include "ui/app_list/views/start_page_view.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "ui/app_list/app_list_constants.h" 9 #include "ui/app_list/app_list_constants.h"
10 #include "ui/app_list/app_list_item.h" 10 #include "ui/app_list/app_list_item.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 instant_container_->AddChildView(search_box_spacer_view_); 225 instant_container_->AddChildView(search_box_spacer_view_);
226 } 226 }
227 227
228 void StartPageView::MaybeOpenCustomLauncherPage() { 228 void StartPageView::MaybeOpenCustomLauncherPage() {
229 // Switch to the custom page. 229 // Switch to the custom page.
230 ContentsView* contents_view = app_list_main_view_->contents_view(); 230 ContentsView* contents_view = app_list_main_view_->contents_view();
231 if (!app_list_main_view_->ShouldShowCustomLauncherPage()) 231 if (!app_list_main_view_->ShouldShowCustomLauncherPage())
232 return; 232 return;
233 233
234 int custom_page_index = contents_view->GetPageIndexForState( 234 contents_view->SetActivePage(AppListModel::STATE_CUSTOM_LAUNCHER_PAGE);
235 AppListModel::STATE_CUSTOM_LAUNCHER_PAGE);
236 contents_view->SetActivePage(custom_page_index);
237 } 235 }
238 236
239 void StartPageView::Reset() { 237 void StartPageView::Reset() {
240 tiles_container_->Update(); 238 tiles_container_->Update();
241 } 239 }
242 240
243 void StartPageView::UpdateForTesting() { 241 void StartPageView::UpdateForTesting() {
244 tiles_container_->Update(); 242 tiles_container_->Update();
245 } 243 }
246 244
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 354
357 gfx::Rect StartPageView::GetSearchBoxBounds() const { 355 gfx::Rect StartPageView::GetSearchBoxBounds() const {
358 return search_box_spacer_view_->bounds(); 356 return search_box_spacer_view_->bounds();
359 } 357 }
360 358
361 TileItemView* StartPageView::GetTileItemView(size_t index) { 359 TileItemView* StartPageView::GetTileItemView(size_t index) {
362 return tiles_container_->GetTileItemView(index); 360 return tiles_container_->GetTileItemView(index);
363 } 361 }
364 362
365 } // namespace app_list 363 } // namespace app_list
OLDNEW
« ui/app_list/views/contents_view.h ('K') | « ui/app_list/views/contents_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698