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

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

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Make patch smaller temporarily. Created 4 years, 9 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 (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/native_scroll_bar_views.h" 5 #include "ui/views/controls/scrollbar/native_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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 ScrollBar* scroll_bar_; 66 ScrollBar* scroll_bar_;
67 }; 67 };
68 68
69 ///////////////////////////////////////////////////////////////////////////// 69 /////////////////////////////////////////////////////////////////////////////
70 // ScrollBarButton 70 // ScrollBarButton
71 71
72 ScrollBarButton::ScrollBarButton(ButtonListener* listener, Type type) 72 ScrollBarButton::ScrollBarButton(ButtonListener* listener, Type type)
73 : BaseScrollBarButton(listener), 73 : BaseScrollBarButton(listener),
74 type_(type) { 74 type_(type) {
75 SetFocusable(false); 75 SetFocusBehavior(NEVER);
76 SetAccessibilityFocusable(false);
77 } 76 }
78 77
79 ScrollBarButton::~ScrollBarButton() { 78 ScrollBarButton::~ScrollBarButton() {
80 } 79 }
81 80
82 gfx::Size ScrollBarButton::GetPreferredSize() const { 81 gfx::Size ScrollBarButton::GetPreferredSize() const {
83 return GetNativeTheme()->GetPartSize(GetNativeThemePart(), 82 return GetNativeTheme()->GetPartSize(GetNativeThemePart(),
84 GetNativeThemeState(), 83 GetNativeThemeState(),
85 GetNativeThemeParams()); 84 GetNativeThemeParams());
86 } 85 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 NOTREACHED(); 142 NOTREACHED();
144 return ui::NativeTheme::kNormal; 143 return ui::NativeTheme::kNormal;
145 } 144 }
146 145
147 ///////////////////////////////////////////////////////////////////////////// 146 /////////////////////////////////////////////////////////////////////////////
148 // ScrollBarThumb 147 // ScrollBarThumb
149 148
150 ScrollBarThumb::ScrollBarThumb(BaseScrollBar* scroll_bar) 149 ScrollBarThumb::ScrollBarThumb(BaseScrollBar* scroll_bar)
151 : BaseScrollBarThumb(scroll_bar), 150 : BaseScrollBarThumb(scroll_bar),
152 scroll_bar_(scroll_bar) { 151 scroll_bar_(scroll_bar) {
153 SetFocusable(false); 152 SetFocusBehavior(NEVER);
154 SetAccessibilityFocusable(false);
155 } 153 }
156 154
157 ScrollBarThumb::~ScrollBarThumb() { 155 ScrollBarThumb::~ScrollBarThumb() {
158 } 156 }
159 157
160 gfx::Size ScrollBarThumb::GetPreferredSize() const { 158 gfx::Size ScrollBarThumb::GetPreferredSize() const {
161 return GetNativeTheme()->GetPartSize(GetNativeThemePart(), 159 return GetNativeTheme()->GetPartSize(GetNativeThemePart(),
162 GetNativeThemeState(), 160 GetNativeThemeState(),
163 GetNativeThemeParams()); 161 GetNativeThemeParams());
164 } 162 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 thumb_params.scrollbar_thumb.is_hovering = false; 398 thumb_params.scrollbar_thumb.is_hovering = false;
401 gfx::Size track_size = theme->GetPartSize( 399 gfx::Size track_size = theme->GetPartSize(
402 ui::NativeTheme::kScrollbarVerticalThumb, 400 ui::NativeTheme::kScrollbarVerticalThumb,
403 ui::NativeTheme::kNormal, 401 ui::NativeTheme::kNormal,
404 thumb_params); 402 thumb_params);
405 403
406 return std::max(track_size.width(), button_size.width()); 404 return std::max(track_size.width(), button_size.width());
407 } 405 }
408 406
409 } // namespace views 407 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698