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

Side by Side Diff: views/controls/native_control_win.cc

Issue 3056045: Improvements to accessibility extension api support for "views":... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | « views/controls/native_control_gtk.cc ('k') | views/focus/focus_manager_win.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/native_control_win.h" 5 #include "views/controls/native_control_win.h"
6 6
7 #include <windowsx.h> 7 #include <windowsx.h>
8 8
9 #include "app/l10n_util_win.h" 9 #include "app/l10n_util_win.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 void NativeControlWin::Focus() { 96 void NativeControlWin::Focus() {
97 DCHECK(native_view()); 97 DCHECK(native_view());
98 SetFocus(native_view()); 98 SetFocus(native_view());
99 99
100 // Since we are being wrapped by a view, accessibility should receive 100 // Since we are being wrapped by a view, accessibility should receive
101 // the super class as the focused view. 101 // the super class as the focused view.
102 View* parent_view = GetParent(); 102 View* parent_view = GetParent();
103 103
104 // Due to some controls not behaving as expected without having 104 // Due to some controls not behaving as expected without having
105 // a native win32 control, we exclude the following from sending 105 // a native win32 control, we don't always send a native (MSAA)
106 // their IAccessible as focus events. 106 // focus notification.
107 if (parent_view->GetClassName() != views::Combobox::kViewClassName && 107 bool send_native_event =
108 parent_view->HasFocus()) 108 parent_view->GetClassName() != views::Combobox::kViewClassName &&
109 parent_view->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS); 109 parent_view->HasFocus();
110
111 // Send the accessibility focus notification.
112 parent_view->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS,
113 send_native_event);
110 } 114 }
111 115
112 //////////////////////////////////////////////////////////////////////////////// 116 ////////////////////////////////////////////////////////////////////////////////
113 // NativeControlWin, protected: 117 // NativeControlWin, protected:
114 118
115 void NativeControlWin::ShowContextMenu(const gfx::Point& location) { 119 void NativeControlWin::ShowContextMenu(const gfx::Point& location) {
116 if (!GetContextMenuController()) 120 if (!GetContextMenuController())
117 return; 121 return;
118 122
119 if (location.x() == -1 && location.y() == -1) 123 if (location.x() == -1 && location.y() == -1)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 211 }
208 } else if (message == WM_DESTROY) { 212 } else if (message == WM_DESTROY) {
209 win_util::SetWindowProc(window, native_control->original_wndproc_); 213 win_util::SetWindowProc(window, native_control->original_wndproc_);
210 } 214 }
211 215
212 return CallWindowProc(native_control->original_wndproc_, window, message, 216 return CallWindowProc(native_control->original_wndproc_, window, message,
213 w_param, l_param); 217 w_param, l_param);
214 } 218 }
215 219
216 } // namespace views 220 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/native_control_gtk.cc ('k') | views/focus/focus_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698