| OLD | NEW |
| 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/native_control_win.h" | 5 #include "ui/views/controls/native_control_win.h" |
| 6 | 6 |
| 7 #include <windowsx.h> | 7 #include <windowsx.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/base/accessibility/accessibility_types.h" | 10 #include "ui/base/accessibility/accessibility_types.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 View* parent_view = parent(); | 106 View* parent_view = parent(); |
| 107 | 107 |
| 108 // Due to some controls not behaving as expected without having | 108 // Due to some controls not behaving as expected without having |
| 109 // a native win32 control, we don't always send a native (MSAA) | 109 // a native win32 control, we don't always send a native (MSAA) |
| 110 // focus notification. | 110 // focus notification. |
| 111 bool send_native_event = | 111 bool send_native_event = |
| 112 parent_view->GetClassName() != Combobox::kViewClassName && | 112 parent_view->GetClassName() != Combobox::kViewClassName && |
| 113 parent_view->HasFocus(); | 113 parent_view->HasFocus(); |
| 114 | 114 |
| 115 // Send the accessibility focus notification. | 115 // Send the accessibility focus notification. |
| 116 if (parent_view->GetWidget()) { | 116 parent_view->NotifyAccessibilityEvent( |
| 117 parent_view->GetWidget()->NotifyAccessibilityEvent( | 117 ui::AccessibilityTypes::EVENT_FOCUS, send_native_event); |
| 118 parent_view, ui::AccessibilityTypes::EVENT_FOCUS, send_native_event); | |
| 119 } | |
| 120 } | 118 } |
| 121 | 119 |
| 122 //////////////////////////////////////////////////////////////////////////////// | 120 //////////////////////////////////////////////////////////////////////////////// |
| 123 // NativeControlWin, protected: | 121 // NativeControlWin, protected: |
| 124 | 122 |
| 125 void NativeControlWin::ShowContextMenu(const gfx::Point& location) { | 123 void NativeControlWin::ShowContextMenu(const gfx::Point& location) { |
| 126 if (!context_menu_controller()) | 124 if (!context_menu_controller()) |
| 127 return; | 125 return; |
| 128 | 126 |
| 129 if (location.x() == -1 && location.y() == -1) | 127 if (location.x() == -1 && location.y() == -1) |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } else if (message == WM_DESTROY) { | 215 } else if (message == WM_DESTROY) { |
| 218 native_control->props_.clear(); | 216 native_control->props_.clear(); |
| 219 ui::SetWindowProc(window, native_control->original_wndproc_); | 217 ui::SetWindowProc(window, native_control->original_wndproc_); |
| 220 } | 218 } |
| 221 | 219 |
| 222 return CallWindowProc(native_control->original_wndproc_, window, message, | 220 return CallWindowProc(native_control->original_wndproc_, window, message, |
| 223 w_param, l_param); | 221 w_param, l_param); |
| 224 } | 222 } |
| 225 | 223 |
| 226 } // namespace views | 224 } // namespace views |
| OLD | NEW |