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

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

Issue 2982453002: New AppListView Scroll Behavior. (Closed)
Patch Set: Addressed comments. Created 3 years, 5 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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 } 403 }
404 404
405 MaybeOpenCustomLauncherPage(); 405 MaybeOpenCustomLauncherPage();
406 return true; 406 return true;
407 } 407 }
408 408
409 bool StartPageView::OnMouseWheel(const ui::MouseWheelEvent& event) { 409 bool StartPageView::OnMouseWheel(const ui::MouseWheelEvent& event) {
410 // Negative y_offset is a downward scroll. 410 // Negative y_offset is a downward scroll.
411 if (event.y_offset() < 0) { 411 if (event.y_offset() < 0) {
412 MaybeOpenCustomLauncherPage(); 412 MaybeOpenCustomLauncherPage();
413 return true; 413 return IsCustomLauncherPageActive();
414 } 414 }
415 415
416 return false; 416 return false;
417 } 417 }
418 418
419 void StartPageView::OnGestureEvent(ui::GestureEvent* event) { 419 void StartPageView::OnGestureEvent(ui::GestureEvent* event) {
420 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN && 420 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN &&
421 event->details().scroll_y_hint() < 0) { 421 event->details().scroll_y_hint() < 0) {
422 MaybeOpenCustomLauncherPage(); 422 MaybeOpenCustomLauncherPage();
423 } 423 }
(...skipping 13 matching lines...) Expand all
437 // is enabled). 437 // is enabled).
438 if (event->type() == ui::ET_SCROLL && event->y_offset() < 0) 438 if (event->type() == ui::ET_SCROLL && event->y_offset() < 0)
439 MaybeOpenCustomLauncherPage(); 439 MaybeOpenCustomLauncherPage();
440 } 440 }
441 441
442 TileItemView* StartPageView::GetTileItemView(size_t index) { 442 TileItemView* StartPageView::GetTileItemView(size_t index) {
443 return suggestions_container_->GetTileItemView(index); 443 return suggestions_container_->GetTileItemView(index);
444 } 444 }
445 445
446 } // namespace app_list 446 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698