| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 "content/browser/renderer_host/legacy_render_widget_host_win.h" | 5 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "content/browser/accessibility/browser_accessibility_manager_win.h" | 10 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 LRESULT LegacyRenderWidgetHostHWND::OnEraseBkGnd(UINT message, | 127 LRESULT LegacyRenderWidgetHostHWND::OnEraseBkGnd(UINT message, |
| 128 WPARAM w_param, | 128 WPARAM w_param, |
| 129 LPARAM l_param) { | 129 LPARAM l_param) { |
| 130 return 1; | 130 return 1; |
| 131 } | 131 } |
| 132 | 132 |
| 133 LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message, | 133 LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message, |
| 134 WPARAM w_param, | 134 WPARAM w_param, |
| 135 LPARAM l_param) { | 135 LPARAM l_param) { |
| 136 if (kIdScreenReaderHoneyPot == l_param) { | 136 // Explicitly cast to DWORD for 64-bit support. |
| 137 DWORD obj_id = static_cast<DWORD>(l_param); |
| 138 |
| 139 if (kIdScreenReaderHoneyPot == obj_id) { |
| 137 // When an MSAA client has responded to our fake event on this id, | 140 // When an MSAA client has responded to our fake event on this id, |
| 138 // enable screen reader support. | 141 // enable screen reader support. |
| 139 BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); | 142 BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); |
| 140 return static_cast<LRESULT>(0L); | 143 return static_cast<LRESULT>(0L); |
| 141 } | 144 } |
| 142 | 145 |
| 143 if (OBJID_CLIENT != l_param || !manager_) | 146 if (OBJID_CLIENT != obj_id || !manager_) |
| 144 return static_cast<LRESULT>(0L); | 147 return static_cast<LRESULT>(0L); |
| 145 | 148 |
| 146 base::win::ScopedComPtr<IAccessible> root( | 149 base::win::ScopedComPtr<IAccessible> root( |
| 147 manager_->GetRoot()->ToBrowserAccessibilityWin()); | 150 manager_->GetRoot()->ToBrowserAccessibilityWin()); |
| 148 return LresultFromObject(IID_IAccessible, w_param, | 151 return LresultFromObject(IID_IAccessible, w_param, |
| 149 static_cast<IAccessible*>(root.Detach())); | 152 static_cast<IAccessible*>(root.Detach())); |
| 150 } | 153 } |
| 151 | 154 |
| 152 // We send keyboard/mouse/touch messages to the parent window via SendMessage. | 155 // We send keyboard/mouse/touch messages to the parent window via SendMessage. |
| 153 // While this works, this has the side effect of converting input messages into | 156 // While this works, this has the side effect of converting input messages into |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 // generate the legacy WM_VSCROLL/WM_HSCROLL messages. | 321 // generate the legacy WM_VSCROLL/WM_HSCROLL messages. |
| 319 // We add these styles to ensure that trackpad/trackpoint scrolling | 322 // We add these styles to ensure that trackpad/trackpoint scrolling |
| 320 // work. | 323 // work. |
| 321 long current_style = ::GetWindowLong(hwnd(), GWL_STYLE); | 324 long current_style = ::GetWindowLong(hwnd(), GWL_STYLE); |
| 322 ::SetWindowLong(hwnd(), GWL_STYLE, | 325 ::SetWindowLong(hwnd(), GWL_STYLE, |
| 323 current_style | WS_VSCROLL | WS_HSCROLL); | 326 current_style | WS_VSCROLL | WS_HSCROLL); |
| 324 return 0; | 327 return 0; |
| 325 } | 328 } |
| 326 | 329 |
| 327 } // namespace content | 330 } // namespace content |
| OLD | NEW |