| 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 "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 void RenderWidgetHostImpl::ResetAccessibilityMode() { | 2079 void RenderWidgetHostImpl::ResetAccessibilityMode() { |
| 2080 SetAccessibilityMode( | 2080 SetAccessibilityMode( |
| 2081 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()); | 2081 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()); |
| 2082 } | 2082 } |
| 2083 | 2083 |
| 2084 void RenderWidgetHostImpl::SetAccessibilityMode(AccessibilityMode mode) { | 2084 void RenderWidgetHostImpl::SetAccessibilityMode(AccessibilityMode mode) { |
| 2085 accessibility_mode_ = mode; | 2085 accessibility_mode_ = mode; |
| 2086 Send(new ViewMsg_SetAccessibilityMode(GetRoutingID(), mode)); | 2086 Send(new ViewMsg_SetAccessibilityMode(GetRoutingID(), mode)); |
| 2087 } | 2087 } |
| 2088 | 2088 |
| 2089 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) { |
| 2090 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id)); |
| 2091 view_->OnAccessibilitySetFocus(object_id); |
| 2092 } |
| 2093 |
| 2089 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) { | 2094 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) { |
| 2090 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id)); | 2095 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id)); |
| 2091 } | 2096 } |
| 2092 | 2097 |
| 2093 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) { | 2098 void RenderWidgetHostImpl::AccessibilityShowMenu(int object_id) { |
| 2094 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id)); | 2099 view_->AccessibilityShowMenu(object_id); |
| 2095 } | 2100 } |
| 2096 | 2101 |
| 2097 void RenderWidgetHostImpl::AccessibilityScrollToMakeVisible( | 2102 void RenderWidgetHostImpl::AccessibilityScrollToMakeVisible( |
| 2098 int acc_obj_id, gfx::Rect subfocus) { | 2103 int acc_obj_id, gfx::Rect subfocus) { |
| 2099 Send(new AccessibilityMsg_ScrollToMakeVisible( | 2104 Send(new AccessibilityMsg_ScrollToMakeVisible( |
| 2100 GetRoutingID(), acc_obj_id, subfocus)); | 2105 GetRoutingID(), acc_obj_id, subfocus)); |
| 2101 } | 2106 } |
| 2102 | 2107 |
| 2103 void RenderWidgetHostImpl::AccessibilityScrollToPoint( | 2108 void RenderWidgetHostImpl::AccessibilityScrollToPoint( |
| 2104 int acc_obj_id, gfx::Point point) { | 2109 int acc_obj_id, gfx::Point point) { |
| 2105 Send(new AccessibilityMsg_ScrollToPoint( | 2110 Send(new AccessibilityMsg_ScrollToPoint( |
| 2106 GetRoutingID(), acc_obj_id, point)); | 2111 GetRoutingID(), acc_obj_id, point)); |
| 2107 } | 2112 } |
| 2108 | 2113 |
| 2109 void RenderWidgetHostImpl::AccessibilitySetTextSelection( | 2114 void RenderWidgetHostImpl::AccessibilitySetTextSelection( |
| 2110 int object_id, int start_offset, int end_offset) { | 2115 int object_id, int start_offset, int end_offset) { |
| 2111 Send(new AccessibilityMsg_SetTextSelection( | 2116 Send(new AccessibilityMsg_SetTextSelection( |
| 2112 GetRoutingID(), object_id, start_offset, end_offset)); | 2117 GetRoutingID(), object_id, start_offset, end_offset)); |
| 2113 } | 2118 } |
| 2114 | 2119 |
| 2115 void RenderWidgetHostImpl::FatalAccessibilityTreeError() { | 2120 bool RenderWidgetHostImpl::AccessibilityViewHasFocus() const { |
| 2121 return view_->HasFocus(); |
| 2122 } |
| 2123 |
| 2124 gfx::Rect RenderWidgetHostImpl::AccessibilityGetViewBounds() const { |
| 2125 return view_->GetViewBounds(); |
| 2126 } |
| 2127 |
| 2128 gfx::Point RenderWidgetHostImpl::AccessibilityOriginInScreen( |
| 2129 const gfx::Rect& bounds) const { |
| 2130 return view_->AccessibilityOriginInScreen(bounds); |
| 2131 } |
| 2132 |
| 2133 void RenderWidgetHostImpl::AccessibilityFatalError() { |
| 2116 Send(new AccessibilityMsg_FatalError(GetRoutingID())); | 2134 Send(new AccessibilityMsg_FatalError(GetRoutingID())); |
| 2135 view_->SetBrowserAccessibilityManager(NULL); |
| 2117 } | 2136 } |
| 2118 | 2137 |
| 2119 #if defined(OS_WIN) | 2138 #if defined(OS_WIN) |
| 2120 void RenderWidgetHostImpl::SetParentNativeViewAccessible( | 2139 void RenderWidgetHostImpl::SetParentNativeViewAccessible( |
| 2121 gfx::NativeViewAccessible accessible_parent) { | 2140 gfx::NativeViewAccessible accessible_parent) { |
| 2122 if (view_) | 2141 if (view_) |
| 2123 view_->SetParentNativeViewAccessible(accessible_parent); | 2142 view_->SetParentNativeViewAccessible(accessible_parent); |
| 2124 } | 2143 } |
| 2125 | 2144 |
| 2126 gfx::NativeViewAccessible | 2145 gfx::NativeViewAccessible |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2409 } | 2428 } |
| 2410 } | 2429 } |
| 2411 | 2430 |
| 2412 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2431 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2413 if (view_) | 2432 if (view_) |
| 2414 return view_->PreferredReadbackFormat(); | 2433 return view_->PreferredReadbackFormat(); |
| 2415 return SkBitmap::kARGB_8888_Config; | 2434 return SkBitmap::kARGB_8888_Config; |
| 2416 } | 2435 } |
| 2417 | 2436 |
| 2418 } // namespace content | 2437 } // namespace content |
| OLD | NEW |