Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/contents_view.h" | 5 #include "ui/app_list/views/contents_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 } | 69 } |
| 70 | 70 |
| 71 apps_container_view_ = new AppsContainerView(app_list_main_view_, model); | 71 apps_container_view_ = new AppsContainerView(app_list_main_view_, model); |
| 72 | 72 |
| 73 int initial_page_index = AddLauncherPage( | 73 int initial_page_index = AddLauncherPage( |
| 74 apps_container_view_, IDR_APP_LIST_APPS_ICON, NAMED_PAGE_APPS); | 74 apps_container_view_, IDR_APP_LIST_APPS_ICON, NAMED_PAGE_APPS); |
| 75 if (app_list::switches::IsExperimentalAppListEnabled()) | 75 if (app_list::switches::IsExperimentalAppListEnabled()) |
| 76 initial_page_index = GetPageIndexForNamedPage(NAMED_PAGE_START); | 76 initial_page_index = GetPageIndexForNamedPage(NAMED_PAGE_START); |
| 77 | 77 |
| 78 pagination_model_.SelectPage(initial_page_index, false); | 78 pagination_model_.SelectPage(initial_page_index, false); |
| 79 if (contents_switcher_view_) | |
| 80 contents_switcher_view_->SelectedPageChanged(-1, initial_page_index); | |
|
calamity
2014/07/09 05:50:19
Is this necessary? I would think the line above wo
kcarattini
2014/07/09 06:45:22
I would have thought so too, but it doesn't seem t
| |
| 79 | 81 |
| 80 // Needed to update the main search box visibility. | 82 // Needed to update the main search box visibility. |
| 81 ActivePageChanged(false); | 83 ActivePageChanged(false); |
| 82 } | 84 } |
| 83 | 85 |
| 84 void ContentsView::CancelDrag() { | 86 void ContentsView::CancelDrag() { |
| 85 if (apps_container_view_->apps_grid_view()->has_dragged_view()) | 87 if (apps_container_view_->apps_grid_view()->has_dragged_view()) |
| 86 apps_container_view_->apps_grid_view()->EndDrag(true); | 88 apps_container_view_->apps_grid_view()->EndDrag(true); |
| 87 if (apps_container_view_->app_list_folder_view() | 89 if (apps_container_view_->app_list_folder_view() |
| 88 ->items_grid_view() | 90 ->items_grid_view() |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 return true; | 313 return true; |
| 312 } | 314 } |
| 313 | 315 |
| 314 return false; | 316 return false; |
| 315 } | 317 } |
| 316 | 318 |
| 317 void ContentsView::TotalPagesChanged() { | 319 void ContentsView::TotalPagesChanged() { |
| 318 } | 320 } |
| 319 | 321 |
| 320 void ContentsView::SelectedPageChanged(int old_selected, int new_selected) { | 322 void ContentsView::SelectedPageChanged(int old_selected, int new_selected) { |
| 323 if (contents_switcher_view_) | |
| 324 contents_switcher_view_->SelectedPageChanged(old_selected, new_selected); | |
| 321 } | 325 } |
| 322 | 326 |
| 323 void ContentsView::TransitionStarted() { | 327 void ContentsView::TransitionStarted() { |
| 324 } | 328 } |
| 325 | 329 |
| 326 void ContentsView::TransitionChanged() { | 330 void ContentsView::TransitionChanged() { |
| 327 UpdatePageBounds(); | 331 UpdatePageBounds(); |
| 328 } | 332 } |
| 329 | 333 |
| 330 void ContentsView::OnGestureEvent(ui::GestureEvent* event) { | 334 void ContentsView::OnGestureEvent(ui::GestureEvent* event) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 if (std::abs(offset) > kMinScrollToSwitchPage) { | 382 if (std::abs(offset) > kMinScrollToSwitchPage) { |
| 379 if (!GetAppsPaginationModel()->has_transition()) { | 383 if (!GetAppsPaginationModel()->has_transition()) { |
| 380 GetAppsPaginationModel()->SelectPageRelative(offset > 0 ? -1 : 1, true); | 384 GetAppsPaginationModel()->SelectPageRelative(offset > 0 ? -1 : 1, true); |
| 381 } | 385 } |
| 382 event->SetHandled(); | 386 event->SetHandled(); |
| 383 event->StopPropagation(); | 387 event->StopPropagation(); |
| 384 } | 388 } |
| 385 } | 389 } |
| 386 | 390 |
| 387 } // namespace app_list | 391 } // namespace app_list |
| OLD | NEW |