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

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: more_rebase Created 5 years, 9 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
« no previous file with comments | « ui/app_list/views/contents_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 7 #include <string>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 void StartPageView::MaybeOpenCustomLauncherPage() { 272 void StartPageView::MaybeOpenCustomLauncherPage() {
273 // Switch to the custom page. 273 // Switch to the custom page.
274 ContentsView* contents_view = app_list_main_view_->contents_view(); 274 ContentsView* contents_view = app_list_main_view_->contents_view();
275 if (!app_list_main_view_->ShouldShowCustomLauncherPage()) 275 if (!app_list_main_view_->ShouldShowCustomLauncherPage())
276 return; 276 return;
277 277
278 UMA_HISTOGRAM_ENUMERATION(kPageOpenedHistogram, 278 UMA_HISTOGRAM_ENUMERATION(kPageOpenedHistogram,
279 AppListModel::STATE_CUSTOM_LAUNCHER_PAGE, 279 AppListModel::STATE_CUSTOM_LAUNCHER_PAGE,
280 AppListModel::STATE_LAST); 280 AppListModel::STATE_LAST);
281 281
282 int custom_page_index = contents_view->GetPageIndexForState( 282 contents_view->SetActiveState(AppListModel::STATE_CUSTOM_LAUNCHER_PAGE);
283 AppListModel::STATE_CUSTOM_LAUNCHER_PAGE);
284 contents_view->SetActivePage(custom_page_index);
285 } 283 }
286 284
287 void StartPageView::Reset() { 285 void StartPageView::Reset() {
288 tiles_container_->Update(); 286 tiles_container_->Update();
289 } 287 }
290 288
291 void StartPageView::UpdateForTesting() { 289 void StartPageView::UpdateForTesting() {
292 tiles_container_->Update(); 290 tiles_container_->Update();
293 } 291 }
294 292
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 441
444 gfx::Rect StartPageView::GetSearchBoxBounds() const { 442 gfx::Rect StartPageView::GetSearchBoxBounds() const {
445 return search_box_spacer_view_->bounds(); 443 return search_box_spacer_view_->bounds();
446 } 444 }
447 445
448 TileItemView* StartPageView::GetTileItemView(size_t index) { 446 TileItemView* StartPageView::GetTileItemView(size_t index) {
449 return tiles_container_->GetTileItemView(index); 447 return tiles_container_->GetTileItemView(index);
450 } 448 }
451 449
452 } // namespace app_list 450 } // namespace app_list
OLDNEW
« no previous file with comments | « 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