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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "content/common/content_constants_internal.h" | 35 #include "content/common/content_constants_internal.h" |
36 #include "content/common/gpu/gpu_messages.h" | 36 #include "content/common/gpu/gpu_messages.h" |
37 #include "content/common/view_messages.h" | 37 #include "content/common/view_messages.h" |
38 #include "content/port/browser/render_widget_host_view_port.h" | 38 #include "content/port/browser/render_widget_host_view_port.h" |
39 #include "content/port/browser/smooth_scroll_gesture.h" | 39 #include "content/port/browser/smooth_scroll_gesture.h" |
40 #include "content/public/browser/compositor_util.h" | 40 #include "content/public/browser/compositor_util.h" |
41 #include "content/public/browser/native_web_keyboard_event.h" | 41 #include "content/public/browser/native_web_keyboard_event.h" |
42 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
43 #include "content/public/browser/notification_types.h" | 43 #include "content/public/browser/notification_types.h" |
44 #include "content/public/browser/user_metrics.h" | 44 #include "content/public/browser/user_metrics.h" |
| 45 #include "content/public/common/accessibility_mode.h" |
45 #include "content/public/common/content_constants.h" | 46 #include "content/public/common/content_constants.h" |
46 #include "content/public/common/content_switches.h" | 47 #include "content/public/common/content_switches.h" |
47 #include "content/public/common/result_codes.h" | 48 #include "content/public/common/result_codes.h" |
48 #include "skia/ext/image_operations.h" | 49 #include "skia/ext/image_operations.h" |
49 #include "skia/ext/platform_canvas.h" | 50 #include "skia/ext/platform_canvas.h" |
50 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 51 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
51 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
52 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebScreenInfoFact
ory.h" | 53 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebScreenInfoFact
ory.h" |
53 #endif | 54 #endif |
54 #include "ui/base/events/event.h" | 55 #include "ui/base/events/event.h" |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); | 797 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); |
797 } | 798 } |
798 | 799 |
799 void RenderWidgetHostImpl::StopHangMonitorTimeout() { | 800 void RenderWidgetHostImpl::StopHangMonitorTimeout() { |
800 time_when_considered_hung_ = Time(); | 801 time_when_considered_hung_ = Time(); |
801 RendererIsResponsive(); | 802 RendererIsResponsive(); |
802 // We do not bother to stop the hung_renderer_timer_ here in case it will be | 803 // We do not bother to stop the hung_renderer_timer_ here in case it will be |
803 // started again shortly, which happens to be the common use case. | 804 // started again shortly, which happens to be the common use case. |
804 } | 805 } |
805 | 806 |
806 void RenderWidgetHostImpl::EnableFullAccessibilityMode() { | |
807 SetAccessibilityMode(AccessibilityModeComplete); | |
808 } | |
809 | |
810 static WebGestureEvent MakeGestureEvent(WebInputEvent::Type type, | 807 static WebGestureEvent MakeGestureEvent(WebInputEvent::Type type, |
811 double timestamp_seconds, | 808 double timestamp_seconds, |
812 int x, | 809 int x, |
813 int y, | 810 int y, |
814 int modifiers) { | 811 int modifiers) { |
815 WebGestureEvent result; | 812 WebGestureEvent result; |
816 | 813 |
817 result.type = type; | 814 result.type = type; |
818 result.x = x; | 815 result.x = x; |
819 result.y = y; | 816 result.y = y; |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2183 | 2180 |
2184 void RenderWidgetHostImpl::SetBackground(const SkBitmap& background) { | 2181 void RenderWidgetHostImpl::SetBackground(const SkBitmap& background) { |
2185 Send(new ViewMsg_SetBackground(GetRoutingID(), background)); | 2182 Send(new ViewMsg_SetBackground(GetRoutingID(), background)); |
2186 } | 2183 } |
2187 | 2184 |
2188 void RenderWidgetHostImpl::SetEditCommandsForNextKeyEvent( | 2185 void RenderWidgetHostImpl::SetEditCommandsForNextKeyEvent( |
2189 const std::vector<EditCommand>& commands) { | 2186 const std::vector<EditCommand>& commands) { |
2190 Send(new ViewMsg_SetEditCommandsForNextKeyEvent(GetRoutingID(), commands)); | 2187 Send(new ViewMsg_SetEditCommandsForNextKeyEvent(GetRoutingID(), commands)); |
2191 } | 2188 } |
2192 | 2189 |
| 2190 AccessibilityMode RenderWidgetHostImpl::GetAccessibilityMode() const { |
| 2191 return accessibility_mode_; |
| 2192 } |
| 2193 |
2193 void RenderWidgetHostImpl::SetAccessibilityMode(AccessibilityMode mode) { | 2194 void RenderWidgetHostImpl::SetAccessibilityMode(AccessibilityMode mode) { |
2194 Send(new ViewMsg_SetAccessibilityMode(routing_id_, mode)); | 2195 Send(new ViewMsg_SetAccessibilityMode(routing_id_, mode)); |
2195 } | 2196 } |
2196 | 2197 |
2197 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) { | 2198 void RenderWidgetHostImpl::AccessibilityDoDefaultAction(int object_id) { |
2198 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id)); | 2199 Send(new AccessibilityMsg_DoDefaultAction(GetRoutingID(), object_id)); |
2199 } | 2200 } |
2200 | 2201 |
2201 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) { | 2202 void RenderWidgetHostImpl::AccessibilitySetFocus(int object_id) { |
2202 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id)); | 2203 Send(new AccessibilityMsg_SetFocus(GetRoutingID(), object_id)); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2366 return; | 2367 return; |
2367 | 2368 |
2368 OnRenderAutoResized(new_size); | 2369 OnRenderAutoResized(new_size); |
2369 } | 2370 } |
2370 | 2371 |
2371 void RenderWidgetHostImpl::DetachDelegate() { | 2372 void RenderWidgetHostImpl::DetachDelegate() { |
2372 delegate_ = NULL; | 2373 delegate_ = NULL; |
2373 } | 2374 } |
2374 | 2375 |
2375 } // namespace content | 2376 } // namespace content |
OLD | NEW |