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

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

Issue 2496643002: Implement Sebastien's overlay scrollbars for native UI (Views). (Closed)
Patch Set: fix test failure Created 4 years, 1 month 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') | ui/views/controls/scroll_view_unittest.cc » ('j') | 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 if (vert_sb_->visible()) 450 if (vert_sb_->visible())
451 processed = vert_sb_->OnMouseWheel(e); 451 processed = vert_sb_->OnMouseWheel(e);
452 452
453 if (horiz_sb_->visible()) 453 if (horiz_sb_->visible())
454 processed = horiz_sb_->OnMouseWheel(e) || processed; 454 processed = horiz_sb_->OnMouseWheel(e) || processed;
455 455
456 return processed; 456 return processed;
457 } 457 }
458 458
459 void ScrollView::OnMouseEntered(const ui::MouseEvent& event) {
460 if (horiz_sb_)
461 horiz_sb_->OnMouseEnteredScrollView(event);
462 if (vert_sb_)
463 vert_sb_->OnMouseEnteredScrollView(event);
464 }
465
466 void ScrollView::OnMouseExited(const ui::MouseEvent& event) {
467 if (horiz_sb_)
468 horiz_sb_->OnMouseExitedScrollView(event);
469 if (vert_sb_)
470 vert_sb_->OnMouseExitedScrollView(event);
471 }
472
473 void ScrollView::OnScrollEvent(ui::ScrollEvent* event) { 459 void ScrollView::OnScrollEvent(ui::ScrollEvent* event) {
474 #if defined(OS_MACOSX) 460 #if defined(OS_MACOSX)
475 // TODO(tapted): Send |event| to a cc::InputHandler. For now, there's nothing 461 // TODO(tapted): Send |event| to a cc::InputHandler. For now, there's nothing
476 // to do because Widget::OnScrollEvent() will automatically process an 462 // to do because Widget::OnScrollEvent() will automatically process an
477 // unhandled ScrollEvent as a MouseWheelEvent. 463 // unhandled ScrollEvent as a MouseWheelEvent.
478 #endif 464 #endif
479 } 465 }
480 466
481 void ScrollView::OnGestureEvent(ui::GestureEvent* event) { 467 void ScrollView::OnGestureEvent(ui::GestureEvent* event) {
482 // If the event happened on one of the scrollbars, then those events are 468 // If the event happened on one of the scrollbars, then those events are
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 771
786 VariableRowHeightScrollHelper::RowInfo 772 VariableRowHeightScrollHelper::RowInfo
787 FixedRowHeightScrollHelper::GetRowInfo(int y) { 773 FixedRowHeightScrollHelper::GetRowInfo(int y) {
788 if (y < top_margin_) 774 if (y < top_margin_)
789 return RowInfo(0, top_margin_); 775 return RowInfo(0, top_margin_);
790 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, 776 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_,
791 row_height_); 777 row_height_);
792 } 778 }
793 779
794 } // namespace views 780 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698