| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2111 render_widget_host_->AccessibilitySetFocus(acc_obj_id); | 2111 render_widget_host_->AccessibilitySetFocus(acc_obj_id); |
| 2112 } | 2112 } |
| 2113 | 2113 |
| 2114 void RenderWidgetHostViewWin::AccessibilityDoDefaultAction(int acc_obj_id) { | 2114 void RenderWidgetHostViewWin::AccessibilityDoDefaultAction(int acc_obj_id) { |
| 2115 if (!render_widget_host_) | 2115 if (!render_widget_host_) |
| 2116 return; | 2116 return; |
| 2117 | 2117 |
| 2118 render_widget_host_->AccessibilityDoDefaultAction(acc_obj_id); | 2118 render_widget_host_->AccessibilityDoDefaultAction(acc_obj_id); |
| 2119 } | 2119 } |
| 2120 | 2120 |
| 2121 void RenderWidgetHostViewWin::AccessibilityChangeScrollPosition( |
| 2122 int acc_obj_id, int scroll_x, int scroll_y) { |
| 2123 if (!render_widget_host_) |
| 2124 return; |
| 2125 |
| 2126 render_widget_host_->AccessibilityChangeScrollPosition( |
| 2127 acc_obj_id, scroll_x, scroll_y); |
| 2128 } |
| 2129 |
| 2130 void RenderWidgetHostViewWin::AccessibilitySetTextSelection( |
| 2131 int acc_obj_id, int start_offset, int end_offset) { |
| 2132 if (!render_widget_host_) |
| 2133 return; |
| 2134 |
| 2135 render_widget_host_->AccessibilitySetTextSelection( |
| 2136 acc_obj_id, start_offset, end_offset); |
| 2137 } |
| 2138 |
| 2121 IAccessible* RenderWidgetHostViewWin::GetIAccessible() { | 2139 IAccessible* RenderWidgetHostViewWin::GetIAccessible() { |
| 2122 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) { | 2140 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) { |
| 2123 // Attempt to detect screen readers by sending an event with our custom id. | 2141 // Attempt to detect screen readers by sending an event with our custom id. |
| 2124 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); | 2142 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); |
| 2125 } | 2143 } |
| 2126 | 2144 |
| 2127 if (!browser_accessibility_manager_.get()) { | 2145 if (!browser_accessibility_manager_.get()) { |
| 2128 // Return busy document tree while renderer accessibility tree loads. | 2146 // Return busy document tree while renderer accessibility tree loads. |
| 2129 WebAccessibility::State busy_state = | 2147 WebAccessibility::State busy_state = |
| 2130 static_cast<WebAccessibility::State>(1 << WebAccessibility::STATE_BUSY); | 2148 static_cast<WebAccessibility::State>(1 << WebAccessibility::STATE_BUSY); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 | 2498 |
| 2481 size_t offset = selection_range_.GetMin() - selection_text_offset_; | 2499 size_t offset = selection_range_.GetMin() - selection_text_offset_; |
| 2482 memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING), | 2500 memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING), |
| 2483 selection_text_.c_str() + offset, len * sizeof(WCHAR)); | 2501 selection_text_.c_str() + offset, len * sizeof(WCHAR)); |
| 2484 | 2502 |
| 2485 // According to Microsft API document, IMR_RECONVERTSTRING and | 2503 // According to Microsft API document, IMR_RECONVERTSTRING and |
| 2486 // IMR_DOCUMENTFEED should return reconv, but some applications return | 2504 // IMR_DOCUMENTFEED should return reconv, but some applications return |
| 2487 // need_size. | 2505 // need_size. |
| 2488 return reinterpret_cast<LRESULT>(reconv); | 2506 return reinterpret_cast<LRESULT>(reconv); |
| 2489 } | 2507 } |
| OLD | NEW |