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 15 matching lines...) Loading... | |
26 #include "cc/output/compositor_frame.h" | 26 #include "cc/output/compositor_frame.h" |
27 #include "cc/output/compositor_frame_ack.h" | 27 #include "cc/output/compositor_frame_ack.h" |
28 #include "content/browser/accessibility/accessibility_mode_helper.h" | 28 #include "content/browser/accessibility/accessibility_mode_helper.h" |
29 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 29 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
30 #include "content/browser/bad_message.h" | 30 #include "content/browser/bad_message.h" |
31 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 31 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
32 #include "content/browser/gpu/compositor_util.h" | 32 #include "content/browser/gpu/compositor_util.h" |
33 #include "content/browser/gpu/gpu_process_host.h" | 33 #include "content/browser/gpu/gpu_process_host.h" |
34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
35 #include "content/browser/gpu/gpu_surface_tracker.h" | 35 #include "content/browser/gpu/gpu_surface_tracker.h" |
36 #include "content/browser/renderer_host/compositor_impl_android.h" | |
jdduke (slow)
2015/07/31 16:35:25
We definitely can't include this without a guard.
| |
36 #include "content/browser/renderer_host/dip_util.h" | 37 #include "content/browser/renderer_host/dip_util.h" |
37 #include "content/browser/renderer_host/frame_metadata_util.h" | 38 #include "content/browser/renderer_host/frame_metadata_util.h" |
38 #include "content/browser/renderer_host/input/input_router_config_helper.h" | 39 #include "content/browser/renderer_host/input/input_router_config_helper.h" |
39 #include "content/browser/renderer_host/input/input_router_impl.h" | 40 #include "content/browser/renderer_host/input/input_router_impl.h" |
40 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 41 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
41 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" | 42 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
42 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 43 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
43 #include "content/browser/renderer_host/input/timeout_monitor.h" | 44 #include "content/browser/renderer_host/input/timeout_monitor.h" |
44 #include "content/browser/renderer_host/input/touch_emulator.h" | 45 #include "content/browser/renderer_host/input/touch_emulator.h" |
45 #include "content/browser/renderer_host/render_process_host_impl.h" | 46 #include "content/browser/renderer_host/render_process_host_impl.h" |
(...skipping 153 matching lines...) Loading... | |
199 CHECK(result.second) << "Inserting a duplicate item!"; | 200 CHECK(result.second) << "Inserting a duplicate item!"; |
200 process_->AddRoute(routing_id_, this); | 201 process_->AddRoute(routing_id_, this); |
201 | 202 |
202 // If we're initially visible, tell the process host that we're alive. | 203 // If we're initially visible, tell the process host that we're alive. |
203 // Otherwise we'll notify the process host when we are first shown. | 204 // Otherwise we'll notify the process host when we are first shown. |
204 if (!hidden) | 205 if (!hidden) |
205 process_->WidgetRestored(); | 206 process_->WidgetRestored(); |
206 | 207 |
207 latency_tracker_.Initialize(routing_id_, GetProcess()->GetID()); | 208 latency_tracker_.Initialize(routing_id_, GetProcess()->GetID()); |
208 | 209 |
210 bool using_browser_compositor = CompositorImpl::IsInitialized(); | |
209 input_router_.reset(new InputRouterImpl( | 211 input_router_.reset(new InputRouterImpl( |
210 process_, this, this, routing_id_, GetInputRouterConfigForPlatform())); | 212 process_, this, this, routing_id_, |
213 GetInputRouterConfigForPlatform(using_browser_compositor))); | |
211 | 214 |
212 touch_emulator_.reset(); | 215 touch_emulator_.reset(); |
213 | 216 |
214 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | 217 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
215 IsRenderView() ? RenderViewHost::From(this) : NULL); | 218 IsRenderView() ? RenderViewHost::From(this) : NULL); |
216 if (BrowserPluginGuest::IsGuest(rvh) || | 219 if (BrowserPluginGuest::IsGuest(rvh) || |
217 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 220 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
218 switches::kDisableHangMonitor)) { | 221 switches::kDisableHangMonitor)) { |
219 hang_monitor_timeout_.reset(new TimeoutMonitor( | 222 hang_monitor_timeout_.reset(new TimeoutMonitor( |
220 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, | 223 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, |
(...skipping 995 matching lines...) Loading... | |
1216 gfx::GLSurfaceHandle()); | 1219 gfx::GLSurfaceHandle()); |
1217 view_->RenderProcessGone(status, exit_code); | 1220 view_->RenderProcessGone(status, exit_code); |
1218 view_ = NULL; // The View should be deleted by RenderProcessGone. | 1221 view_ = NULL; // The View should be deleted by RenderProcessGone. |
1219 view_weak_.reset(); | 1222 view_weak_.reset(); |
1220 } | 1223 } |
1221 | 1224 |
1222 // Reconstruct the input router to ensure that it has fresh state for a new | 1225 // Reconstruct the input router to ensure that it has fresh state for a new |
1223 // renderer. Otherwise it may be stuck waiting for the old renderer to ack an | 1226 // renderer. Otherwise it may be stuck waiting for the old renderer to ack an |
1224 // event. (In particular, the above call to view_->RenderProcessGone will | 1227 // event. (In particular, the above call to view_->RenderProcessGone will |
1225 // destroy the aura window, which may dispatch a synthetic mouse move.) | 1228 // destroy the aura window, which may dispatch a synthetic mouse move.) |
1229 bool using_browser_compositor = CompositorImpl::IsInitialized(); | |
1226 input_router_.reset(new InputRouterImpl( | 1230 input_router_.reset(new InputRouterImpl( |
1227 process_, this, this, routing_id_, GetInputRouterConfigForPlatform())); | 1231 process_, this, this, routing_id_, |
1232 GetInputRouterConfigForPlatform(using_browser_compositor))); | |
1228 | 1233 |
1229 synthetic_gesture_controller_.reset(); | 1234 synthetic_gesture_controller_.reset(); |
1230 } | 1235 } |
1231 | 1236 |
1232 void RenderWidgetHostImpl::UpdateTextDirection(WebTextDirection direction) { | 1237 void RenderWidgetHostImpl::UpdateTextDirection(WebTextDirection direction) { |
1233 text_direction_updated_ = true; | 1238 text_direction_updated_ = true; |
1234 text_direction_ = direction; | 1239 text_direction_ = direction; |
1235 } | 1240 } |
1236 | 1241 |
1237 void RenderWidgetHostImpl::CancelUpdateTextDirection() { | 1242 void RenderWidgetHostImpl::CancelUpdateTextDirection() { |
(...skipping 846 matching lines...) Loading... | |
2084 } | 2089 } |
2085 | 2090 |
2086 #if defined(OS_WIN) | 2091 #if defined(OS_WIN) |
2087 gfx::NativeViewAccessible | 2092 gfx::NativeViewAccessible |
2088 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2093 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
2089 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2094 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
2090 } | 2095 } |
2091 #endif | 2096 #endif |
2092 | 2097 |
2093 } // namespace content | 2098 } // namespace content |
OLD | NEW |