Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 866173002: Plugin Power Saver: Add UI Overlay to throttled plugin using placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stray comment. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 return bound_graphics_2d_platform_->PrepareTextureMailbox(mailbox, 2036 return bound_graphics_2d_platform_->PrepareTextureMailbox(mailbox,
2037 release_callback); 2037 release_callback);
2038 } 2038 }
2039 2039
2040 void PepperPluginInstanceImpl::OnDestruct() { render_frame_ = NULL; } 2040 void PepperPluginInstanceImpl::OnDestruct() { render_frame_ = NULL; }
2041 2041
2042 void PepperPluginInstanceImpl::OnThrottleStateChange() { 2042 void PepperPluginInstanceImpl::OnThrottleStateChange() {
2043 SendDidChangeView(); 2043 SendDidChangeView();
2044 } 2044 }
2045 2045
2046 void PepperPluginInstanceImpl::OnHiddenForPlaceholder(bool hidden) {
2047 if (hidden) {
piman 2015/02/05 00:34:36 thinking about this a little more, you also need t
tommycli 2015/02/05 00:46:35 Done. I put this flag in the throttler, since dmic
2048 container_->setWebLayer(nullptr);
2049 } else {
2050 UpdateLayer(true /* device_changed */);
2051 }
2052 }
2053
2046 void PepperPluginInstanceImpl::AddLatencyInfo( 2054 void PepperPluginInstanceImpl::AddLatencyInfo(
2047 const std::vector<ui::LatencyInfo>& latency_info) { 2055 const std::vector<ui::LatencyInfo>& latency_info) {
2048 if (render_frame_ && render_frame_->GetRenderWidget()) { 2056 if (render_frame_ && render_frame_->GetRenderWidget()) {
2049 RenderWidgetCompositor* compositor = 2057 RenderWidgetCompositor* compositor =
2050 render_frame_->GetRenderWidget()->compositor(); 2058 render_frame_->GetRenderWidget()->compositor();
2051 if (compositor) { 2059 if (compositor) {
2052 for (size_t i = 0; i < latency_info.size(); i++) { 2060 for (size_t i = 0; i < latency_info.size(); i++) {
2053 scoped_ptr<cc::SwapPromise> swap_promise( 2061 scoped_ptr<cc::SwapPromise> swap_promise(
2054 new cc::LatencyInfoSwapPromise(latency_info[i])); 2062 new cc::LatencyInfoSwapPromise(latency_info[i]));
2055 compositor->QueueSwapPromise(swap_promise.Pass()); 2063 compositor->QueueSwapPromise(swap_promise.Pass());
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
3277 3285
3278 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { 3286 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() {
3279 if (!javascript_used_ && is_flash_plugin_) { 3287 if (!javascript_used_ && is_flash_plugin_) {
3280 javascript_used_ = true; 3288 javascript_used_ = true;
3281 RenderThread::Get()->RecordAction( 3289 RenderThread::Get()->RecordAction(
3282 base::UserMetricsAction("Flash.JavaScriptUsed")); 3290 base::UserMetricsAction("Flash.JavaScriptUsed"));
3283 } 3291 }
3284 } 3292 }
3285 3293
3286 } // namespace content 3294 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/plugin_instance_throttler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698