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

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

Issue 78803002: Fixing focus highlight on high DPI devices for accessibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/message_center/views/padded_button.cc ('k') | ui/views/focus_border.h » ('j') | 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/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 state->role = ui::AccessibilityTypes::ROLE_SLIDER; 313 state->role = ui::AccessibilityTypes::ROLE_SLIDER;
314 state->name = accessible_name_; 314 state->name = accessible_name_;
315 state->value = UTF8ToUTF16( 315 state->value = UTF8ToUTF16(
316 base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5))); 316 base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5)));
317 } 317 }
318 318
319 void Slider::OnPaintFocusBorder(gfx::Canvas* canvas) { 319 void Slider::OnPaintFocusBorder(gfx::Canvas* canvas) {
320 if (!focus_border_color_) { 320 if (!focus_border_color_) {
321 View::OnPaintFocusBorder(canvas); 321 View::OnPaintFocusBorder(canvas);
322 } else if (HasFocus()) { 322 } else if (HasFocus()) {
323 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3), 323 canvas->DrawSolidFocusRect(
324 focus_border_color_); 324 gfx::Rect(1, 1, width() - 3, height() - 3),
325 focus_border_color_);
325 } 326 }
326 } 327 }
327 328
328 } // namespace views 329 } // namespace views
OLDNEW
« no previous file with comments | « ui/message_center/views/padded_button.cc ('k') | ui/views/focus_border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698