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

Side by Side Diff: ui/views/controls/button/custom_button.cc

Issue 1693713004: Don't fire a FOCUS accessibility event on a View that doesn't have focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed one call to SendFocusAlert Created 4 years, 10 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
« no previous file with comments | « ui/app_list/views/tile_item_view.cc ('k') | ui/views/controls/tree/tree_view.cc » ('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/button/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "ui/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 void CustomButton::SetAnimationDuration(int duration) { 100 void CustomButton::SetAnimationDuration(int duration) {
101 hover_animation_.SetSlideDuration(duration); 101 hover_animation_.SetSlideDuration(duration);
102 } 102 }
103 103
104 void CustomButton::SetHotTracked(bool is_hot_tracked) { 104 void CustomButton::SetHotTracked(bool is_hot_tracked) {
105 if (state_ != STATE_DISABLED) 105 if (state_ != STATE_DISABLED)
106 SetState(is_hot_tracked ? STATE_HOVERED : STATE_NORMAL); 106 SetState(is_hot_tracked ? STATE_HOVERED : STATE_NORMAL);
107 107
108 if (is_hot_tracked) 108 if (is_hot_tracked)
109 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true); 109 NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true);
110 } 110 }
111 111
112 bool CustomButton::IsHotTracked() const { 112 bool CustomButton::IsHotTracked() const {
113 return state_ == STATE_HOVERED; 113 return state_ == STATE_HOVERED;
114 } 114 }
115 115
116 //////////////////////////////////////////////////////////////////////////////// 116 ////////////////////////////////////////////////////////////////////////////////
117 // CustomButton, View overrides: 117 // CustomButton, View overrides:
118 118
119 void CustomButton::Layout() { 119 void CustomButton::Layout() {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 Button::NotifyClick(event); 447 Button::NotifyClick(event);
448 } 448 }
449 449
450 void CustomButton::OnClickCanceled(const ui::Event& event) { 450 void CustomButton::OnClickCanceled(const ui::Event& event) {
451 if (ink_drop_delegate()) 451 if (ink_drop_delegate())
452 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); 452 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN);
453 Button::OnClickCanceled(event); 453 Button::OnClickCanceled(event);
454 } 454 }
455 455
456 } // namespace views 456 } // namespace views
OLDNEW
« no previous file with comments | « ui/app_list/views/tile_item_view.cc ('k') | ui/views/controls/tree/tree_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698