| OLD | NEW |
| 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 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 } | 2102 } |
| 2103 | 2103 |
| 2104 #if defined(ENABLE_PLUGINS) | 2104 #if defined(ENABLE_PLUGINS) |
| 2105 void RenderFrameImpl::RegisterPeripheralPlugin( | 2105 void RenderFrameImpl::RegisterPeripheralPlugin( |
| 2106 const url::Origin& content_origin, | 2106 const url::Origin& content_origin, |
| 2107 const base::Closure& unthrottle_callback) { | 2107 const base::Closure& unthrottle_callback) { |
| 2108 return plugin_power_saver_helper_->RegisterPeripheralPlugin( | 2108 return plugin_power_saver_helper_->RegisterPeripheralPlugin( |
| 2109 content_origin, unthrottle_callback); | 2109 content_origin, unthrottle_callback); |
| 2110 } | 2110 } |
| 2111 | 2111 |
| 2112 bool RenderFrameImpl::ShouldThrottleContent( | 2112 RenderFrame::PeripheralContentStatus |
| 2113 RenderFrameImpl::GetPeripheralContentStatus( |
| 2113 const url::Origin& main_frame_origin, | 2114 const url::Origin& main_frame_origin, |
| 2114 const url::Origin& content_origin, | 2115 const url::Origin& content_origin, |
| 2115 int width, | 2116 const gfx::Size& unobscured_size) const { |
| 2116 int height, | 2117 return plugin_power_saver_helper_->GetPeripheralContentStatus( |
| 2117 bool* cross_origin_main_content) const { | 2118 main_frame_origin, content_origin, unobscured_size); |
| 2118 return plugin_power_saver_helper_->ShouldThrottleContent( | |
| 2119 main_frame_origin, content_origin, width, height, | |
| 2120 cross_origin_main_content); | |
| 2121 } | 2119 } |
| 2122 | 2120 |
| 2123 void RenderFrameImpl::WhitelistContentOrigin( | 2121 void RenderFrameImpl::WhitelistContentOrigin( |
| 2124 const url::Origin& content_origin) { | 2122 const url::Origin& content_origin) { |
| 2125 return plugin_power_saver_helper_->WhitelistContentOrigin(content_origin); | 2123 return plugin_power_saver_helper_->WhitelistContentOrigin(content_origin); |
| 2126 } | 2124 } |
| 2127 #endif // defined(ENABLE_PLUGINS) | 2125 #endif // defined(ENABLE_PLUGINS) |
| 2128 | 2126 |
| 2129 bool RenderFrameImpl::IsFTPDirectoryListing() { | 2127 bool RenderFrameImpl::IsFTPDirectoryListing() { |
| 2130 WebURLResponseExtraDataImpl* extra_data = | 2128 WebURLResponseExtraDataImpl* extra_data = |
| (...skipping 3385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5516 media::ConvertToSwitchOutputDeviceCB(web_callbacks); | 5514 media::ConvertToSwitchOutputDeviceCB(web_callbacks); |
| 5517 scoped_refptr<media::AudioOutputDevice> device = | 5515 scoped_refptr<media::AudioOutputDevice> device = |
| 5518 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), | 5516 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), |
| 5519 security_origin); | 5517 security_origin); |
| 5520 media::OutputDeviceStatus status = device->GetDeviceStatus(); | 5518 media::OutputDeviceStatus status = device->GetDeviceStatus(); |
| 5521 device->Stop(); | 5519 device->Stop(); |
| 5522 callback.Run(status); | 5520 callback.Run(status); |
| 5523 } | 5521 } |
| 5524 | 5522 |
| 5525 } // namespace content | 5523 } // namespace content |
| OLD | NEW |