| Index: ui/app_list/views/contents_view.cc
|
| diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc
|
| index 997c6c3b5fcdf8fcd32652d635f0a9b2199c5f47..c10bc447a0f30c1cc9face30d70a3fbb2a477f68 100644
|
| --- a/ui/app_list/views/contents_view.cc
|
| +++ b/ui/app_list/views/contents_view.cc
|
| @@ -25,16 +25,6 @@
|
|
|
| namespace app_list {
|
|
|
| -namespace {
|
| -
|
| -const int kMinMouseWheelToSwitchPage = 20;
|
| -const int kMinScrollToSwitchPage = 20;
|
| -const int kMinHorizVelocityToSwitchPage = 800;
|
| -
|
| -const double kFinishTransitionThreshold = 0.33;
|
| -
|
| -} // namespace
|
| -
|
| ContentsView::ContentsView(AppListMainView* app_list_main_view)
|
| : search_results_view_(NULL),
|
| start_page_view_(NULL),
|
| @@ -246,9 +236,7 @@ void ContentsView::ShowFolderContent(AppListFolderItem* item) {
|
| }
|
|
|
| void ContentsView::Prerender() {
|
| - const int selected_page =
|
| - std::max(0, GetAppsPaginationModel()->selected_page());
|
| - apps_container_view_->apps_grid_view()->Prerender(selected_page);
|
| + apps_container_view_->apps_grid_view()->Prerender();
|
| }
|
|
|
| views::View* ContentsView::GetPageView(int index) {
|
| @@ -313,26 +301,6 @@ bool ContentsView::OnKeyPressed(const ui::KeyEvent& event) {
|
| return view_model_->view_at(GetActivePageIndex())->OnKeyPressed(event);
|
| }
|
|
|
| -bool ContentsView::OnMouseWheel(const ui::MouseWheelEvent& event) {
|
| - if (!IsNamedPageActive(NAMED_PAGE_APPS))
|
| - return false;
|
| -
|
| - int offset;
|
| - if (abs(event.x_offset()) > abs(event.y_offset()))
|
| - offset = event.x_offset();
|
| - else
|
| - offset = event.y_offset();
|
| -
|
| - if (abs(offset) > kMinMouseWheelToSwitchPage) {
|
| - if (!GetAppsPaginationModel()->has_transition()) {
|
| - GetAppsPaginationModel()->SelectPageRelative(offset > 0 ? -1 : 1, true);
|
| - }
|
| - return true;
|
| - }
|
| -
|
| - return false;
|
| -}
|
| -
|
| void ContentsView::TotalPagesChanged() {
|
| }
|
|
|
| @@ -346,61 +314,4 @@ void ContentsView::TransitionChanged() {
|
| UpdatePageBounds();
|
| }
|
|
|
| -void ContentsView::OnGestureEvent(ui::GestureEvent* event) {
|
| - if (!IsNamedPageActive(NAMED_PAGE_APPS))
|
| - return;
|
| -
|
| - switch (event->type()) {
|
| - case ui::ET_GESTURE_SCROLL_BEGIN:
|
| - GetAppsPaginationModel()->StartScroll();
|
| - event->SetHandled();
|
| - return;
|
| - case ui::ET_GESTURE_SCROLL_UPDATE:
|
| - // event->details.scroll_x() > 0 means moving contents to right. That is,
|
| - // transitioning to previous page.
|
| - GetAppsPaginationModel()->UpdateScroll(event->details().scroll_x() /
|
| - GetContentsBounds().width());
|
| - event->SetHandled();
|
| - return;
|
| - case ui::ET_GESTURE_SCROLL_END:
|
| - GetAppsPaginationModel()->EndScroll(
|
| - GetAppsPaginationModel()->transition().progress <
|
| - kFinishTransitionThreshold);
|
| - event->SetHandled();
|
| - return;
|
| - case ui::ET_SCROLL_FLING_START: {
|
| - GetAppsPaginationModel()->EndScroll(true);
|
| - if (fabs(event->details().velocity_x()) > kMinHorizVelocityToSwitchPage) {
|
| - GetAppsPaginationModel()->SelectPageRelative(
|
| - event->details().velocity_x() < 0 ? 1 : -1, true);
|
| - }
|
| - event->SetHandled();
|
| - return;
|
| - }
|
| - default:
|
| - break;
|
| - }
|
| -}
|
| -
|
| -void ContentsView::OnScrollEvent(ui::ScrollEvent* event) {
|
| - if (!IsNamedPageActive(NAMED_PAGE_APPS) ||
|
| - event->type() == ui::ET_SCROLL_FLING_CANCEL) {
|
| - return;
|
| - }
|
| -
|
| - float offset;
|
| - if (std::abs(event->x_offset()) > std::abs(event->y_offset()))
|
| - offset = event->x_offset();
|
| - else
|
| - offset = event->y_offset();
|
| -
|
| - if (std::abs(offset) > kMinScrollToSwitchPage) {
|
| - if (!GetAppsPaginationModel()->has_transition()) {
|
| - GetAppsPaginationModel()->SelectPageRelative(offset > 0 ? -1 : 1, true);
|
| - }
|
| - event->SetHandled();
|
| - event->StopPropagation();
|
| - }
|
| -}
|
| -
|
| } // namespace app_list
|
|
|