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

Side by Side Diff: ui/views/controls/scrollbar/scroll_bar_views.cc

Issue 2535943002: Fix event targeting for overlay scrollbar thumbs (in native UI). (Closed)
Patch Set: Created 4 years 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/scrollbar/overlay_scroll_bar.cc ('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/scrollbar/scroll_bar_views.h" 5 #include "ui/views/controls/scrollbar/scroll_bar_views.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/events/keycodes/keyboard_codes.h" 8 #include "ui/events/keycodes/keyboard_codes.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/gfx/path.h" 10 #include "ui/gfx/path.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 } // namespace 197 } // namespace
198 198
199 //////////////////////////////////////////////////////////////////////////////// 199 ////////////////////////////////////////////////////////////////////////////////
200 // ScrollBarViews, public: 200 // ScrollBarViews, public:
201 201
202 const char ScrollBarViews::kViewClassName[] = "ScrollBarViews"; 202 const char ScrollBarViews::kViewClassName[] = "ScrollBarViews";
203 203
204 ScrollBarViews::ScrollBarViews(bool horizontal) 204 ScrollBarViews::ScrollBarViews(bool horizontal)
205 : BaseScrollBar(horizontal, new ScrollBarThumb(this)) { 205 : BaseScrollBar(horizontal) {
206 SetThumb(new ScrollBarThumb(this));
206 if (horizontal) { 207 if (horizontal) {
207 prev_button_ = new ScrollBarButton(this, ScrollBarButton::LEFT); 208 prev_button_ = new ScrollBarButton(this, ScrollBarButton::LEFT);
208 next_button_ = new ScrollBarButton(this, ScrollBarButton::RIGHT); 209 next_button_ = new ScrollBarButton(this, ScrollBarButton::RIGHT);
209 210
210 part_ = ui::NativeTheme::kScrollbarHorizontalTrack; 211 part_ = ui::NativeTheme::kScrollbarHorizontalTrack;
211 } else { 212 } else {
212 prev_button_ = new ScrollBarButton(this, ScrollBarButton::UP); 213 prev_button_ = new ScrollBarButton(this, ScrollBarButton::UP);
213 next_button_ = new ScrollBarButton(this, ScrollBarButton::DOWN); 214 next_button_ = new ScrollBarButton(this, ScrollBarButton::DOWN);
214 215
215 part_ = ui::NativeTheme::kScrollbarVerticalTrack; 216 part_ = ui::NativeTheme::kScrollbarVerticalTrack;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 ui::NativeTheme::ExtraParams thumb_params; 335 ui::NativeTheme::ExtraParams thumb_params;
335 thumb_params.scrollbar_thumb.is_hovering = false; 336 thumb_params.scrollbar_thumb.is_hovering = false;
336 gfx::Size track_size = 337 gfx::Size track_size =
337 theme->GetPartSize(ui::NativeTheme::kScrollbarHorizontalThumb, 338 theme->GetPartSize(ui::NativeTheme::kScrollbarHorizontalThumb,
338 ui::NativeTheme::kNormal, thumb_params); 339 ui::NativeTheme::kNormal, thumb_params);
339 340
340 return std::max(track_size.height(), button_size.height()); 341 return std::max(track_size.height(), button_size.height());
341 } 342 }
342 343
343 } // namespace views 344 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/overlay_scroll_bar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698