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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1497623002: Plugin Power Saver: Improve Poster behavior for essential plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 } 2062 }
2063 2063
2064 #if defined(ENABLE_PLUGINS) 2064 #if defined(ENABLE_PLUGINS)
2065 void RenderFrameImpl::RegisterPeripheralPlugin( 2065 void RenderFrameImpl::RegisterPeripheralPlugin(
2066 const url::Origin& content_origin, 2066 const url::Origin& content_origin,
2067 const base::Closure& unthrottle_callback) { 2067 const base::Closure& unthrottle_callback) {
2068 return plugin_power_saver_helper_->RegisterPeripheralPlugin( 2068 return plugin_power_saver_helper_->RegisterPeripheralPlugin(
2069 content_origin, unthrottle_callback); 2069 content_origin, unthrottle_callback);
2070 } 2070 }
2071 2071
2072 bool RenderFrameImpl::ShouldThrottleContent( 2072 RenderFrame::PeripheralContentStatus
2073 RenderFrameImpl::GetPeripheralContentStatus(
2073 const url::Origin& main_frame_origin, 2074 const url::Origin& main_frame_origin,
2074 const url::Origin& content_origin, 2075 const url::Origin& content_origin,
2075 int width, 2076 const gfx::Size& unobscured_size) const {
2076 int height, 2077 return plugin_power_saver_helper_->GetPeripheralContentStatus(
2077 bool* cross_origin_main_content) const { 2078 main_frame_origin, content_origin, unobscured_size);
2078 return plugin_power_saver_helper_->ShouldThrottleContent(
2079 main_frame_origin, content_origin, width, height,
2080 cross_origin_main_content);
2081 } 2079 }
2082 2080
2083 void RenderFrameImpl::WhitelistContentOrigin( 2081 void RenderFrameImpl::WhitelistContentOrigin(
2084 const url::Origin& content_origin) { 2082 const url::Origin& content_origin) {
2085 return plugin_power_saver_helper_->WhitelistContentOrigin(content_origin); 2083 return plugin_power_saver_helper_->WhitelistContentOrigin(content_origin);
2086 } 2084 }
2087 #endif // defined(ENABLE_PLUGINS) 2085 #endif // defined(ENABLE_PLUGINS)
2088 2086
2089 bool RenderFrameImpl::IsFTPDirectoryListing() { 2087 bool RenderFrameImpl::IsFTPDirectoryListing() {
2090 WebURLResponseExtraDataImpl* extra_data = 2088 WebURLResponseExtraDataImpl* extra_data =
(...skipping 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after
5447 media::ConvertToSwitchOutputDeviceCB(web_callbacks); 5445 media::ConvertToSwitchOutputDeviceCB(web_callbacks);
5448 scoped_refptr<media::AudioOutputDevice> device = 5446 scoped_refptr<media::AudioOutputDevice> device =
5449 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), 5447 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(),
5450 security_origin); 5448 security_origin);
5451 media::OutputDeviceStatus status = device->GetDeviceStatus(); 5449 media::OutputDeviceStatus status = device->GetDeviceStatus();
5452 device->Stop(); 5450 device->Stop();
5453 callback.Run(status); 5451 callback.Run(status);
5454 } 5452 }
5455 5453
5456 } // namespace content 5454 } // namespace content
OLDNEW
« chrome/renderer/plugins/power_saver_info.cc ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698