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

Side by Side Diff: ash/system/tray/actionable_view.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 | « ash/shelf/shelf_view.cc ('k') | ash/system/tray/tray_popup_header_button.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ash/system/tray/actionable_view.h" 5 #include "ash/system/tray/actionable_view.h"
6 6
7 #include "ash/ash_constants.h" 7 #include "ash/ash_constants.h"
8 #include "ui/base/accessibility/accessible_view_state.h" 8 #include "ui/base/accessibility/accessible_view_state.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 10
11 namespace ash { 11 namespace ash {
12 namespace internal { 12 namespace internal {
13 13
14 // static 14 // static
15 const char ActionableView::kViewClassName[] = "tray/ActionableView"; 15 const char ActionableView::kViewClassName[] = "tray/ActionableView";
16 16
17 ActionableView::ActionableView() 17 ActionableView::ActionableView()
18 : has_capture_(false) { 18 : has_capture_(false) {
19 set_focusable(true); 19 set_focusable(true);
20 } 20 }
21 21
22 ActionableView::~ActionableView() { 22 ActionableView::~ActionableView() {
23 } 23 }
24 24
25 void ActionableView::DrawBorder(gfx::Canvas* canvas, const gfx::Rect& bounds) { 25 void ActionableView::DrawBorder(gfx::Canvas* canvas, const gfx::Rect& bounds) {
26 gfx::Rect rect = bounds; 26 gfx::Rect rect = bounds;
27 rect.Inset(1, 1, 3, 3); 27 rect.Inset(1, 1, 3, 2);
28 canvas->DrawRect(rect, kFocusBorderColor); 28 canvas->DrawSolidFocusRect(rect, kFocusBorderColor);
29 } 29 }
30 30
31 const char* ActionableView::GetClassName() const { 31 const char* ActionableView::GetClassName() const {
32 return kViewClassName; 32 return kViewClassName;
33 } 33 }
34 34
35 bool ActionableView::OnKeyPressed(const ui::KeyEvent& event) { 35 bool ActionableView::OnKeyPressed(const ui::KeyEvent& event) {
36 if (event.key_code() == ui::VKEY_SPACE || 36 if (event.key_code() == ui::VKEY_SPACE ||
37 event.key_code() == ui::VKEY_RETURN) { 37 event.key_code() == ui::VKEY_RETURN) {
38 return PerformAction(event); 38 return PerformAction(event);
(...skipping 30 matching lines...) Expand all
69 event->SetHandled(); 69 event->SetHandled();
70 } 70 }
71 71
72 void ActionableView::GetAccessibleState(ui::AccessibleViewState* state) { 72 void ActionableView::GetAccessibleState(ui::AccessibleViewState* state) {
73 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; 73 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
74 state->name = accessible_name_; 74 state->name = accessible_name_;
75 } 75 }
76 76
77 } // namespace internal 77 } // namespace internal
78 } // namespace ash 78 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ash/system/tray/tray_popup_header_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698