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

Side by Side Diff: ui/views/controls/scrollbar/cocoa_scroll_bar.mm

Issue 2192443003: MacViews: Fix scrolling when clicking on the views::ScrollView scroll track (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static const Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "ui/views/controls/scrollbar/cocoa_scroll_bar.h" 5 #import "ui/views/controls/scrollbar/cocoa_scroll_bar.h"
6 6
7 #import "base/mac/sdk_forward_declarations.h" 7 #import "base/mac/sdk_forward_declarations.h"
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "third_party/skia/include/effects/SkGradientShader.h" 9 #include "third_party/skia/include/effects/SkGradientShader.h"
10 #include "ui/compositor/layer.h" 10 #include "ui/compositor/layer.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 bool CocoaScrollBar::OnMousePressed(const ui::MouseEvent& event) { 283 bool CocoaScrollBar::OnMousePressed(const ui::MouseEvent& event) {
284 // Ignore the mouse press if the scrollbar is hidden. 284 // Ignore the mouse press if the scrollbar is hidden.
285 if (IsScrollbarFullyHidden()) 285 if (IsScrollbarFullyHidden())
286 return false; 286 return false;
287 287
288 return BaseScrollBar::OnMousePressed(event); 288 return BaseScrollBar::OnMousePressed(event);
289 } 289 }
290 290
291 void CocoaScrollBar::OnMouseReleased(const ui::MouseEvent& event) { 291 void CocoaScrollBar::OnMouseReleased(const ui::MouseEvent& event) {
292 ResetOverlayScrollbar(); 292 ResetOverlayScrollbar();
293 BaseScrollBar::OnMouseReleased(event);
293 } 294 }
294 295
295 void CocoaScrollBar::OnMouseEntered(const ui::MouseEvent& event) { 296 void CocoaScrollBar::OnMouseEntered(const ui::MouseEvent& event) {
296 if (scroller_style_ != NSScrollerStyleOverlay) 297 if (scroller_style_ != NSScrollerStyleOverlay)
297 return; 298 return;
298 299
299 // If the scrollbar thumb did not completely fade away, then reshow it when 300 // If the scrollbar thumb did not completely fade away, then reshow it when
300 // the mouse enters the scrollbar thumb. 301 // the mouse enters the scrollbar thumb.
301 if (!IsScrollbarFullyHidden()) 302 if (!IsScrollbarFullyHidden())
302 ShowScrollbar(); 303 ShowScrollbar();
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void CocoaScrollBar::SetScrolltrackVisible(bool visible) { 479 void CocoaScrollBar::SetScrolltrackVisible(bool visible) {
479 has_scrolltrack_ = visible; 480 has_scrolltrack_ = visible;
480 SchedulePaint(); 481 SchedulePaint();
481 } 482 }
482 483
483 CocoaScrollBarThumb* CocoaScrollBar::GetCocoaScrollBarThumb() const { 484 CocoaScrollBarThumb* CocoaScrollBar::GetCocoaScrollBarThumb() const {
484 return static_cast<CocoaScrollBarThumb*>(GetThumb()); 485 return static_cast<CocoaScrollBarThumb*>(GetThumb());
485 } 486 }
486 487
487 } // namespace views 488 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar.h ('k') | ui/views/controls/scrollbar/native_scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698