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 13 matching lines...) Expand all Loading... |
24 #include "cc/base/switches.h" | 24 #include "cc/base/switches.h" |
25 #include "cc/output/compositor_frame.h" | 25 #include "cc/output/compositor_frame.h" |
26 #include "cc/output/compositor_frame_ack.h" | 26 #include "cc/output/compositor_frame_ack.h" |
27 #include "content/browser/accessibility/accessibility_mode_helper.h" | 27 #include "content/browser/accessibility/accessibility_mode_helper.h" |
28 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 28 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
29 #include "content/browser/gpu/compositor_util.h" | 29 #include "content/browser/gpu/compositor_util.h" |
30 #include "content/browser/gpu/gpu_process_host.h" | 30 #include "content/browser/gpu/gpu_process_host.h" |
31 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 31 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
32 #include "content/browser/gpu/gpu_surface_tracker.h" | 32 #include "content/browser/gpu/gpu_surface_tracker.h" |
33 #include "content/browser/renderer_host/dip_util.h" | 33 #include "content/browser/renderer_host/dip_util.h" |
| 34 #include "content/browser/renderer_host/input/input_router_config_helper.h" |
34 #include "content/browser/renderer_host/input/input_router_impl.h" | 35 #include "content/browser/renderer_host/input/input_router_impl.h" |
35 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 36 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
36 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" | 37 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
37 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 38 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
38 #include "content/browser/renderer_host/input/timeout_monitor.h" | 39 #include "content/browser/renderer_host/input/timeout_monitor.h" |
39 #include "content/browser/renderer_host/input/touch_emulator.h" | 40 #include "content/browser/renderer_host/input/touch_emulator.h" |
40 #include "content/browser/renderer_host/overscroll_controller.h" | 41 #include "content/browser/renderer_host/overscroll_controller.h" |
41 #include "content/browser/renderer_host/render_process_host_impl.h" | 42 #include "content/browser/renderer_host/render_process_host_impl.h" |
42 #include "content/browser/renderer_host/render_view_host_impl.h" | 43 #include "content/browser/renderer_host/render_view_host_impl.h" |
43 #include "content/browser/renderer_host/render_widget_helper.h" | 44 #include "content/browser/renderer_host/render_widget_helper.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 process_->AddRoute(routing_id_, this); | 223 process_->AddRoute(routing_id_, this); |
223 | 224 |
224 // If we're initially visible, tell the process host that we're alive. | 225 // If we're initially visible, tell the process host that we're alive. |
225 // Otherwise we'll notify the process host when we are first shown. | 226 // Otherwise we'll notify the process host when we are first shown. |
226 if (!hidden) | 227 if (!hidden) |
227 process_->WidgetRestored(); | 228 process_->WidgetRestored(); |
228 | 229 |
229 accessibility_mode_ = | 230 accessibility_mode_ = |
230 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); | 231 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); |
231 | 232 |
232 input_router_.reset(new InputRouterImpl(process_, this, this, routing_id_)); | 233 input_router_.reset(new InputRouterImpl( |
| 234 process_, this, this, routing_id_, GetInputRouterConfigForPlatform())); |
233 | 235 |
234 touch_emulator_.reset(); | 236 touch_emulator_.reset(); |
235 | 237 |
236 #if defined(USE_AURA) | 238 #if defined(USE_AURA) |
237 bool overscroll_enabled = CommandLine::ForCurrentProcess()-> | 239 bool overscroll_enabled = CommandLine::ForCurrentProcess()-> |
238 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; | 240 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; |
239 SetOverscrollControllerEnabled(overscroll_enabled); | 241 SetOverscrollControllerEnabled(overscroll_enabled); |
240 #endif | 242 #endif |
241 | 243 |
242 if (GetProcess()->IsGuest() || !CommandLine::ForCurrentProcess()->HasSwitch( | 244 if (GetProcess()->IsGuest() || !CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 | 1213 |
1212 void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status, | 1214 void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status, |
1213 int exit_code) { | 1215 int exit_code) { |
1214 // Clearing this flag causes us to re-create the renderer when recovering | 1216 // Clearing this flag causes us to re-create the renderer when recovering |
1215 // from a crashed renderer. | 1217 // from a crashed renderer. |
1216 renderer_initialized_ = false; | 1218 renderer_initialized_ = false; |
1217 | 1219 |
1218 waiting_for_screen_rects_ack_ = false; | 1220 waiting_for_screen_rects_ack_ = false; |
1219 | 1221 |
1220 // Reset to ensure that input routing works with a new renderer. | 1222 // Reset to ensure that input routing works with a new renderer. |
1221 input_router_.reset(new InputRouterImpl(process_, this, this, routing_id_)); | 1223 input_router_.reset(new InputRouterImpl( |
| 1224 process_, this, this, routing_id_, GetInputRouterConfigForPlatform())); |
1222 | 1225 |
1223 if (overscroll_controller_) | 1226 if (overscroll_controller_) |
1224 overscroll_controller_->Reset(); | 1227 overscroll_controller_->Reset(); |
1225 | 1228 |
1226 // Must reset these to ensure that keyboard events work with a new renderer. | 1229 // Must reset these to ensure that keyboard events work with a new renderer. |
1227 suppress_next_char_events_ = false; | 1230 suppress_next_char_events_ = false; |
1228 | 1231 |
1229 // Reset some fields in preparation for recovering from a crash. | 1232 // Reset some fields in preparation for recovering from a crash. |
1230 ResetSizeAndRepaintPendingFlags(); | 1233 ResetSizeAndRepaintPendingFlags(); |
1231 current_size_.SetSize(0, 0); | 1234 current_size_.SetSize(0, 0); |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 } | 2345 } |
2343 } | 2346 } |
2344 | 2347 |
2345 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2348 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
2346 if (view_) | 2349 if (view_) |
2347 return view_->PreferredReadbackFormat(); | 2350 return view_->PreferredReadbackFormat(); |
2348 return SkBitmap::kARGB_8888_Config; | 2351 return SkBitmap::kARGB_8888_Config; |
2349 } | 2352 } |
2350 | 2353 |
2351 } // namespace content | 2354 } // namespace content |
OLD | NEW |