| 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 3308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3319 } | 3319 } |
| 3320 } | 3320 } |
| 3321 | 3321 |
| 3322 if (has_video) { | 3322 if (has_video) { |
| 3323 AddMediaPlayerEntry(player_cookie, &active_video_players_); | 3323 AddMediaPlayerEntry(player_cookie, &active_video_players_); |
| 3324 | 3324 |
| 3325 // If we're not hidden and have just created a player, create a blocker. | 3325 // If we're not hidden and have just created a player, create a blocker. |
| 3326 if (!video_power_save_blocker_ && !IsHidden()) | 3326 if (!video_power_save_blocker_ && !IsHidden()) |
| 3327 CreateVideoPowerSaveBlocker(); | 3327 CreateVideoPowerSaveBlocker(); |
| 3328 } | 3328 } |
| 3329 |
| 3330 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying()); |
| 3329 } | 3331 } |
| 3330 | 3332 |
| 3331 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { | 3333 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { |
| 3332 RemoveMediaPlayerEntry(player_cookie, &active_audio_players_); | 3334 RemoveMediaPlayerEntry(player_cookie, &active_audio_players_); |
| 3333 RemoveMediaPlayerEntry(player_cookie, &active_video_players_); | 3335 RemoveMediaPlayerEntry(player_cookie, &active_video_players_); |
| 3334 MaybeReleasePowerSaveBlockers(); | 3336 MaybeReleasePowerSaveBlockers(); |
| 3337 |
| 3338 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaPaused()); |
| 3335 } | 3339 } |
| 3336 | 3340 |
| 3337 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { | 3341 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { |
| 3338 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3342 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3339 DidFirstVisuallyNonEmptyPaint()); | 3343 DidFirstVisuallyNonEmptyPaint()); |
| 3340 | 3344 |
| 3341 if (theme_color_ != last_sent_theme_color_) { | 3345 if (theme_color_ != last_sent_theme_color_) { |
| 3342 // Theme color should have updated by now if there was one. | 3346 // Theme color should have updated by now if there was one. |
| 3343 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3347 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3344 DidChangeThemeColor(theme_color_)); | 3348 DidChangeThemeColor(theme_color_)); |
| (...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4622 node->render_manager()->ResumeResponseDeferredAtStart(); | 4626 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4623 } | 4627 } |
| 4624 | 4628 |
| 4625 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4629 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4626 force_disable_overscroll_content_ = force_disable; | 4630 force_disable_overscroll_content_ = force_disable; |
| 4627 if (view_) | 4631 if (view_) |
| 4628 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4632 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4629 } | 4633 } |
| 4630 | 4634 |
| 4631 } // namespace content | 4635 } // namespace content |
| OLD | NEW |