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

Unified Diff: ui/views/controls/scroll_view.cc

Issue 16171010: Introduces a new scrollbar for message_center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetVisibleSize -> GetContentOverlapSize Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | ui/views/controls/scrollbar/overlay_scroll_bar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scroll_view.cc
diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
index 3659c35c5db45f75e4a9b98a4ce11debcdaaa410..11ffc020ea7adb4669152ec2f6b0627029ee4e68 100644
--- a/ui/views/controls/scroll_view.cc
+++ b/ui/views/controls/scroll_view.cc
@@ -117,6 +117,8 @@ ScrollView::ScrollView()
vert_sb_(new NativeScrollBar(false)),
resize_corner_(NULL),
hide_horizontal_scrollbar_(false) {
+ set_notify_enter_exit_on_child(true);
+
AddChildView(contents_viewport_);
AddChildView(header_viewport_);
@@ -252,15 +254,17 @@ void ScrollView::Layout() {
}
if (horiz_sb_required) {
+ int height_offset = horiz_sb_->GetContentOverlapSize();
horiz_sb_->SetBounds(0,
- viewport_bounds.bottom(),
+ viewport_bounds.bottom() - height_offset,
viewport_bounds.right(),
- horiz_sb_height);
+ horiz_sb_height + height_offset);
}
if (vert_sb_required) {
- vert_sb_->SetBounds(viewport_bounds.right(),
+ int width_offset = vert_sb_->GetContentOverlapSize();
+ vert_sb_->SetBounds(viewport_bounds.right() - width_offset,
0,
- vert_sb_width,
+ vert_sb_width + width_offset,
viewport_bounds.bottom());
}
if (resize_corner_required) {
@@ -312,6 +316,20 @@ bool ScrollView::OnMouseWheel(const ui::MouseWheelEvent& e) {
return processed;
}
+void ScrollView::OnMouseEntered(const ui::MouseEvent& event) {
+ if (horiz_sb_)
+ horiz_sb_->OnMouseEnteredScrollView(event);
+ if (vert_sb_)
+ vert_sb_->OnMouseEnteredScrollView(event);
+}
+
+void ScrollView::OnMouseExited(const ui::MouseEvent& event) {
+ if (horiz_sb_)
+ horiz_sb_->OnMouseExitedScrollView(event);
+ if (vert_sb_)
+ vert_sb_->OnMouseExitedScrollView(event);
+}
+
void ScrollView::OnGestureEvent(ui::GestureEvent* event) {
// If the event happened on one of the scrollbars, then those events are
// sent directly to the scrollbars. Otherwise, only scroll events are sent to
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | ui/views/controls/scrollbar/overlay_scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698