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