| 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 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2082 } | 2082 } |
| 2083 | 2083 |
| 2084 #if defined(ENABLE_PLUGINS) | 2084 #if defined(ENABLE_PLUGINS) |
| 2085 void RenderFrameImpl::RegisterPeripheralPlugin( | 2085 void RenderFrameImpl::RegisterPeripheralPlugin( |
| 2086 const url::Origin& content_origin, | 2086 const url::Origin& content_origin, |
| 2087 const base::Closure& unthrottle_callback) { | 2087 const base::Closure& unthrottle_callback) { |
| 2088 return plugin_power_saver_helper_->RegisterPeripheralPlugin( | 2088 return plugin_power_saver_helper_->RegisterPeripheralPlugin( |
| 2089 content_origin, unthrottle_callback); | 2089 content_origin, unthrottle_callback); |
| 2090 } | 2090 } |
| 2091 | 2091 |
| 2092 bool RenderFrameImpl::ShouldThrottleContent( | 2092 RenderFrame::PeripheralContentStatus |
| 2093 RenderFrameImpl::GetPeripheralContentStatus( |
| 2093 const url::Origin& main_frame_origin, | 2094 const url::Origin& main_frame_origin, |
| 2094 const url::Origin& content_origin, | 2095 const url::Origin& content_origin, |
| 2095 int width, | 2096 const gfx::Size& unobscured_size) const { |
| 2096 int height, | 2097 return plugin_power_saver_helper_->GetPeripheralContentStatus( |
| 2097 bool* cross_origin_main_content) const { | 2098 main_frame_origin, content_origin, unobscured_size); |
| 2098 return plugin_power_saver_helper_->ShouldThrottleContent( | |
| 2099 main_frame_origin, content_origin, width, height, | |
| 2100 cross_origin_main_content); | |
| 2101 } | 2099 } |
| 2102 | 2100 |
| 2103 void RenderFrameImpl::WhitelistContentOrigin( | 2101 void RenderFrameImpl::WhitelistContentOrigin( |
| 2104 const url::Origin& content_origin) { | 2102 const url::Origin& content_origin) { |
| 2105 return plugin_power_saver_helper_->WhitelistContentOrigin(content_origin); | 2103 return plugin_power_saver_helper_->WhitelistContentOrigin(content_origin); |
| 2106 } | 2104 } |
| 2107 #endif // defined(ENABLE_PLUGINS) | 2105 #endif // defined(ENABLE_PLUGINS) |
| 2108 | 2106 |
| 2109 bool RenderFrameImpl::IsFTPDirectoryListing() { | 2107 bool RenderFrameImpl::IsFTPDirectoryListing() { |
| 2110 WebURLResponseExtraDataImpl* extra_data = | 2108 WebURLResponseExtraDataImpl* extra_data = |
| (...skipping 3381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5492 media::ConvertToSwitchOutputDeviceCB(web_callbacks); | 5490 media::ConvertToSwitchOutputDeviceCB(web_callbacks); |
| 5493 scoped_refptr<media::AudioOutputDevice> device = | 5491 scoped_refptr<media::AudioOutputDevice> device = |
| 5494 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), | 5492 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), |
| 5495 security_origin); | 5493 security_origin); |
| 5496 media::OutputDeviceStatus status = device->GetDeviceStatus(); | 5494 media::OutputDeviceStatus status = device->GetDeviceStatus(); |
| 5497 device->Stop(); | 5495 device->Stop(); |
| 5498 callback.Run(status); | 5496 callback.Run(status); |
| 5499 } | 5497 } |
| 5500 | 5498 |
| 5501 } // namespace content | 5499 } // namespace content |
| OLD | NEW |