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

Side by Side Diff: ui/views/controls/scroll_view.cc

Issue 2193153002: MacViews: Send Mac scrollWheel NSEvents as ui::ET_SCROLL (ui::ScrollEvent). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollLayers
Patch Set: NSDictionary subscripting Created 4 years, 2 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/views/controls/scroll_view.h ('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 (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/views/controls/scroll_view.h" 5 #include "ui/views/controls/scroll_view.h"
6 6
7 #include "base/feature_list.h" 7 #include "base/feature_list.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 vert_sb_->OnMouseEnteredScrollView(event); 452 vert_sb_->OnMouseEnteredScrollView(event);
453 } 453 }
454 454
455 void ScrollView::OnMouseExited(const ui::MouseEvent& event) { 455 void ScrollView::OnMouseExited(const ui::MouseEvent& event) {
456 if (horiz_sb_) 456 if (horiz_sb_)
457 horiz_sb_->OnMouseExitedScrollView(event); 457 horiz_sb_->OnMouseExitedScrollView(event);
458 if (vert_sb_) 458 if (vert_sb_)
459 vert_sb_->OnMouseExitedScrollView(event); 459 vert_sb_->OnMouseExitedScrollView(event);
460 } 460 }
461 461
462 void ScrollView::OnScrollEvent(ui::ScrollEvent* event) {
463 #if defined(OS_MACOSX)
464 // TODO(tapted): Send |event| to a cc::InputHandler. For now, there's nothing
465 // to do because Widget::OnScrollEvent() will automatically process an
466 // unhandled ScrollEvent as a MouseWheelEvent.
467 #endif
468 }
469
462 void ScrollView::OnGestureEvent(ui::GestureEvent* event) { 470 void ScrollView::OnGestureEvent(ui::GestureEvent* event) {
463 // If the event happened on one of the scrollbars, then those events are 471 // If the event happened on one of the scrollbars, then those events are
464 // sent directly to the scrollbars. Otherwise, only scroll events are sent to 472 // sent directly to the scrollbars. Otherwise, only scroll events are sent to
465 // the scrollbars. 473 // the scrollbars.
466 bool scroll_event = event->type() == ui::ET_GESTURE_SCROLL_UPDATE || 474 bool scroll_event = event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
467 event->type() == ui::ET_GESTURE_SCROLL_BEGIN || 475 event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
468 event->type() == ui::ET_GESTURE_SCROLL_END || 476 event->type() == ui::ET_GESTURE_SCROLL_END ||
469 event->type() == ui::ET_SCROLL_FLING_START; 477 event->type() == ui::ET_SCROLL_FLING_START;
470 478
471 if (vert_sb_->visible()) { 479 if (vert_sb_->visible()) {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 766
759 VariableRowHeightScrollHelper::RowInfo 767 VariableRowHeightScrollHelper::RowInfo
760 FixedRowHeightScrollHelper::GetRowInfo(int y) { 768 FixedRowHeightScrollHelper::GetRowInfo(int y) {
761 if (y < top_margin_) 769 if (y < top_margin_)
762 return RowInfo(0, top_margin_); 770 return RowInfo(0, top_margin_);
763 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, 771 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_,
764 row_height_); 772 row_height_);
765 } 773 }
766 774
767 } // namespace views 775 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698