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

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

Issue 13524005: Cleanup: remove NotifyAccessibilityEvent from views::Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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 | « ui/app_list/views/apps_grid_view.cc ('k') | ui/views/controls/button/image_button.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/base/accessibility/accessible_view_state.h" 7 #include "ui/base/accessibility/accessible_view_state.h"
8 #include "ui/base/animation/throb_animation.h" 8 #include "ui/base/animation/throb_animation.h"
9 #include "ui/base/events/event.h" 9 #include "ui/base/events/event.h"
10 #include "ui/base/keycodes/keyboard_codes.h" 10 #include "ui/base/keycodes/keyboard_codes.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 gfx::Point cursor_pos(gfx::Screen::GetScreenFor( 77 gfx::Point cursor_pos(gfx::Screen::GetScreenFor(
78 GetWidget()->GetNativeView())->GetCursorScreenPoint()); 78 GetWidget()->GetNativeView())->GetCursorScreenPoint());
79 ConvertPointToTarget(NULL, this, &cursor_pos); 79 ConvertPointToTarget(NULL, this, &cursor_pos);
80 return HitTestPoint(cursor_pos); 80 return HitTestPoint(cursor_pos);
81 } 81 }
82 82
83 void CustomButton::SetHotTracked(bool is_hot_tracked) { 83 void CustomButton::SetHotTracked(bool is_hot_tracked) {
84 if (state_ != STATE_DISABLED) 84 if (state_ != STATE_DISABLED)
85 SetState(is_hot_tracked ? STATE_HOVERED : STATE_NORMAL); 85 SetState(is_hot_tracked ? STATE_HOVERED : STATE_NORMAL);
86 86
87 if (is_hot_tracked && GetWidget()) { 87 if (is_hot_tracked)
88 GetWidget()->NotifyAccessibilityEvent( 88 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_FOCUS, true);
89 this, ui::AccessibilityTypes::EVENT_FOCUS, true);
90 }
91 } 89 }
92 90
93 bool CustomButton::IsHotTracked() const { 91 bool CustomButton::IsHotTracked() const {
94 return state_ == STATE_HOVERED; 92 return state_ == STATE_HOVERED;
95 } 93 }
96 94
97 //////////////////////////////////////////////////////////////////////////////// 95 ////////////////////////////////////////////////////////////////////////////////
98 // CustomButton, View overrides: 96 // CustomButton, View overrides:
99 97
100 void CustomButton::OnEnabledChanged() { 98 void CustomButton::OnEnabledChanged() {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (!is_add && state_ != STATE_DISABLED) 331 if (!is_add && state_ != STATE_DISABLED)
334 SetState(STATE_NORMAL); 332 SetState(STATE_NORMAL);
335 } 333 }
336 334
337 void CustomButton::OnBlur() { 335 void CustomButton::OnBlur() {
338 if (IsHotTracked()) 336 if (IsHotTracked())
339 SetState(STATE_NORMAL); 337 SetState(STATE_NORMAL);
340 } 338 }
341 339
342 } // namespace views 340 } // namespace views
OLDNEW
« no previous file with comments | « ui/app_list/views/apps_grid_view.cc ('k') | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698