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

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

Issue 10854032: Fix a regression issue which causes slider bar focus border not drawn on focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/slider.h" 5 #include "ui/views/controls/slider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 kFullColor); 211 kFullColor);
212 212
213 button_cx = x + kLineThickness / 2; 213 button_cx = x + kLineThickness / 2;
214 button_cy = content.y() + empty + kButtonRadius; 214 button_cy = content.y() + empty + kButtonRadius;
215 215
216 SkPaint paint; 216 SkPaint paint;
217 paint.setStyle(SkPaint::kFill_Style); 217 paint.setStyle(SkPaint::kFill_Style);
218 paint.setAntiAlias(true); 218 paint.setAntiAlias(true);
219 paint.setColor(kButtonColor); 219 paint.setColor(kButtonColor);
220 canvas->sk_canvas()->drawCircle(button_cx, button_cy, kButtonRadius, paint); 220 canvas->sk_canvas()->drawCircle(button_cx, button_cy, kButtonRadius, paint);
221 View::OnPaint(canvas);
222 } 221 }
222 View::OnPaint(canvas);
223 } 223 }
224 224
225 bool Slider::OnMousePressed(const views::MouseEvent& event) { 225 bool Slider::OnMousePressed(const views::MouseEvent& event) {
226 if (listener_) 226 if (listener_)
227 listener_->SliderDragStarted(this); 227 listener_->SliderDragStarted(this);
228 MoveButtonTo(event.location()); 228 MoveButtonTo(event.location());
229 return true; 229 return true;
230 } 230 }
231 231
232 bool Slider::OnMouseDragged(const views::MouseEvent& event) { 232 bool Slider::OnMouseDragged(const views::MouseEvent& event) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 void Slider::OnPaintFocusBorder(gfx::Canvas* canvas) { 286 void Slider::OnPaintFocusBorder(gfx::Canvas* canvas) {
287 if (!focus_border_color_) { 287 if (!focus_border_color_) {
288 View::OnPaintFocusBorder(canvas); 288 View::OnPaintFocusBorder(canvas);
289 } else if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { 289 } else if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
290 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), 290 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3),
291 focus_border_color_); 291 focus_border_color_);
292 } 292 }
293 } 293 }
294 294
295 } // namespace views 295 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698