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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 497 |
498 // If we are swapping out, we will call ReleaseProcess, allowing the process | 498 // If we are swapping out, we will call ReleaseProcess, allowing the process |
499 // to exit if all of its RenderViews are swapped out. We wait until the | 499 // to exit if all of its RenderViews are swapped out. We wait until the |
500 // WasSwappedOut call to do this, to avoid showing the sad tab. | 500 // WasSwappedOut call to do this, to avoid showing the sad tab. |
501 // If we are swapping in, we call AddRefProcess to prevent the process from | 501 // If we are swapping in, we call AddRefProcess to prevent the process from |
502 // exiting. | 502 // exiting. |
503 if (!is_swapped_out) | 503 if (!is_swapped_out) |
504 RenderProcess::current()->AddRefProcess(); | 504 RenderProcess::current()->AddRefProcess(); |
505 } | 505 } |
506 | 506 |
507 bool RenderWidget::UsingSynchronousRendererCompositor() const { | |
508 #if defined(OS_ANDROID) | |
509 return SynchronousCompositorFactory::GetInstance() != NULL; | |
510 #else | |
511 return false; | |
512 #endif | |
513 } | |
514 | |
515 void RenderWidget::EnableScreenMetricsEmulation( | 507 void RenderWidget::EnableScreenMetricsEmulation( |
516 const WebDeviceEmulationParams& params) { | 508 const WebDeviceEmulationParams& params) { |
517 if (!screen_metrics_emulator_) | 509 if (!screen_metrics_emulator_) |
518 screen_metrics_emulator_.reset(new ScreenMetricsEmulator(this, params)); | 510 screen_metrics_emulator_.reset(new ScreenMetricsEmulator(this, params)); |
519 else | 511 else |
520 screen_metrics_emulator_->ChangeEmulationParams(params); | 512 screen_metrics_emulator_->ChangeEmulationParams(params); |
521 } | 513 } |
522 | 514 |
523 void RenderWidget::DisableScreenMetricsEmulation() { | 515 void RenderWidget::DisableScreenMetricsEmulation() { |
524 screen_metrics_emulator_.reset(); | 516 screen_metrics_emulator_.reset(); |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2060 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2052 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2061 video_hole_frames_.AddObserver(frame); | 2053 video_hole_frames_.AddObserver(frame); |
2062 } | 2054 } |
2063 | 2055 |
2064 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2056 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2065 video_hole_frames_.RemoveObserver(frame); | 2057 video_hole_frames_.RemoveObserver(frame); |
2066 } | 2058 } |
2067 #endif // defined(VIDEO_HOLE) | 2059 #endif // defined(VIDEO_HOLE) |
2068 | 2060 |
2069 } // namespace content | 2061 } // namespace content |
OLD | NEW |