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 |
11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
15 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
16 #include "base/i18n/rtl.h" | 16 #include "base/i18n/rtl.h" |
17 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
19 #include "base/metrics/field_trial.h" | 19 #include "base/metrics/field_trial.h" |
20 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
23 #include "base/thread_task_runner_handle.h" | 23 #include "base/thread_task_runner_handle.h" |
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/browser_plugin/browser_plugin_guest.h" |
29 #include "content/browser/gpu/compositor_util.h" | 30 #include "content/browser/gpu/compositor_util.h" |
30 #include "content/browser/gpu/gpu_process_host.h" | 31 #include "content/browser/gpu/gpu_process_host.h" |
31 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 32 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
32 #include "content/browser/gpu/gpu_surface_tracker.h" | 33 #include "content/browser/gpu/gpu_surface_tracker.h" |
33 #include "content/browser/renderer_host/dip_util.h" | 34 #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_config_helper.h" |
35 #include "content/browser/renderer_host/input/input_router_impl.h" | 36 #include "content/browser/renderer_host/input/input_router_impl.h" |
36 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 37 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
37 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" | 38 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
38 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 39 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 process_, this, this, routing_id_, GetInputRouterConfigForPlatform())); | 232 process_, this, this, routing_id_, GetInputRouterConfigForPlatform())); |
232 | 233 |
233 touch_emulator_.reset(); | 234 touch_emulator_.reset(); |
234 | 235 |
235 #if defined(USE_AURA) | 236 #if defined(USE_AURA) |
236 bool overscroll_enabled = CommandLine::ForCurrentProcess()-> | 237 bool overscroll_enabled = CommandLine::ForCurrentProcess()-> |
237 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; | 238 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; |
238 SetOverscrollControllerEnabled(overscroll_enabled); | 239 SetOverscrollControllerEnabled(overscroll_enabled); |
239 #endif | 240 #endif |
240 | 241 |
241 if (GetProcess()->IsGuest() || !CommandLine::ForCurrentProcess()->HasSwitch( | 242 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
| 243 IsRenderView() ? RenderViewHost::From(this) : NULL); |
| 244 if (BrowserPluginGuest::IsGuest(rvh) || |
| 245 !CommandLine::ForCurrentProcess()->HasSwitch( |
242 switches::kDisableHangMonitor)) { | 246 switches::kDisableHangMonitor)) { |
243 hang_monitor_timeout_.reset(new TimeoutMonitor( | 247 hang_monitor_timeout_.reset(new TimeoutMonitor( |
244 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, | 248 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, |
245 weak_factory_.GetWeakPtr()))); | 249 weak_factory_.GetWeakPtr()))); |
246 } | 250 } |
247 } | 251 } |
248 | 252 |
249 RenderWidgetHostImpl::~RenderWidgetHostImpl() { | 253 RenderWidgetHostImpl::~RenderWidgetHostImpl() { |
250 SetView(NULL); | 254 SetView(NULL); |
251 | 255 |
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2323 } | 2327 } |
2324 } | 2328 } |
2325 | 2329 |
2326 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2330 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
2327 if (view_) | 2331 if (view_) |
2328 return view_->PreferredReadbackFormat(); | 2332 return view_->PreferredReadbackFormat(); |
2329 return SkBitmap::kARGB_8888_Config; | 2333 return SkBitmap::kARGB_8888_Config; |
2330 } | 2334 } |
2331 | 2335 |
2332 } // namespace content | 2336 } // namespace content |
OLD | NEW |