| 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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 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 3087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3098 audio_power_save_blocker_.reset(); | 3098 audio_power_save_blocker_.reset(); |
| 3099 } | 3099 } |
| 3100 | 3100 |
| 3101 // If there are no more video players, clear the video power save blocker. | 3101 // If there are no more video players, clear the video power save blocker. |
| 3102 if (active_video_players_.empty()) | 3102 if (active_video_players_.empty()) |
| 3103 video_power_save_blocker_.reset(); | 3103 video_power_save_blocker_.reset(); |
| 3104 } | 3104 } |
| 3105 | 3105 |
| 3106 void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie, | 3106 void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie, |
| 3107 bool has_video, | 3107 bool has_video, |
| 3108 bool has_audio) { | 3108 bool has_audio, |
| 3109 bool is_remote) { |
| 3110 // Ignore the videos playing remotely and don't hold the wake lock for the |
| 3111 // screen. |
| 3112 if (is_remote) return; |
| 3113 |
| 3109 if (has_audio) { | 3114 if (has_audio) { |
| 3110 AddMediaPlayerEntry(player_cookie, &active_audio_players_); | 3115 AddMediaPlayerEntry(player_cookie, &active_audio_players_); |
| 3111 | 3116 |
| 3112 // If we don't have audio stream monitoring, allocate the audio power save | 3117 // If we don't have audio stream monitoring, allocate the audio power save |
| 3113 // blocker here instead of during NotifyNavigationStateChanged(). | 3118 // blocker here instead of during NotifyNavigationStateChanged(). |
| 3114 if (!audio_power_save_blocker_ && | 3119 if (!audio_power_save_blocker_ && |
| 3115 !AudioStreamMonitor::monitoring_available()) { | 3120 !AudioStreamMonitor::monitoring_available()) { |
| 3116 CreateAudioPowerSaveBlocker(); | 3121 CreateAudioPowerSaveBlocker(); |
| 3117 } | 3122 } |
| 3118 } | 3123 } |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4366 node->render_manager()->ResumeResponseDeferredAtStart(); | 4371 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4367 } | 4372 } |
| 4368 | 4373 |
| 4369 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4374 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4370 force_disable_overscroll_content_ = force_disable; | 4375 force_disable_overscroll_content_ = force_disable; |
| 4371 if (view_) | 4376 if (view_) |
| 4372 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4377 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4373 } | 4378 } |
| 4374 | 4379 |
| 4375 } // namespace content | 4380 } // namespace content |
| OLD | NEW |