| 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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 void WebMediaPlayerImpl::enteredFullscreen() { | 349 void WebMediaPlayerImpl::enteredFullscreen() { |
| 350 // |force_video_overlays_| implies that we're already in overlay mode, so take | 350 // |force_video_overlays_| implies that we're already in overlay mode, so take |
| 351 // no action here. Otherwise, switch to an overlay if it's allowed and if | 351 // no action here. Otherwise, switch to an overlay if it's allowed and if |
| 352 // it will display properly. | 352 // it will display properly. |
| 353 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ && | 353 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ && |
| 354 DoesOverlaySupportMetadata()) { | 354 DoesOverlaySupportMetadata()) { |
| 355 EnableOverlay(); | 355 EnableOverlay(); |
| 356 } | 356 } |
| 357 if (observer_) | 357 if (observer_) |
| 358 observer_->OnEnteredFullscreen(); | 358 observer_->OnEnteredFullscreen(); |
| 359 delegate_->SetIsEffectivelyFullscreen(delegate_id_, true); |
| 359 } | 360 } |
| 360 | 361 |
| 361 void WebMediaPlayerImpl::exitedFullscreen() { | 362 void WebMediaPlayerImpl::exitedFullscreen() { |
| 362 // If we're in overlay mode, then exit it unless we're supposed to be in | 363 // If we're in overlay mode, then exit it unless we're supposed to be in |
| 363 // overlay mode all the time. | 364 // overlay mode all the time. |
| 364 if (!force_video_overlays_ && overlay_enabled_) | 365 if (!force_video_overlays_ && overlay_enabled_) |
| 365 DisableOverlay(); | 366 DisableOverlay(); |
| 366 if (observer_) | 367 if (observer_) |
| 367 observer_->OnExitedFullscreen(); | 368 observer_->OnExitedFullscreen(); |
| 369 delegate_->SetIsEffectivelyFullscreen(delegate_id_, false); |
| 368 } | 370 } |
| 369 | 371 |
| 370 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) { | 372 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) { |
| 371 if (observer_) | 373 if (observer_) |
| 372 observer_->OnBecameDominantVisibleContent(isDominant); | 374 observer_->OnBecameDominantVisibleContent(isDominant); |
| 373 } | 375 } |
| 374 | 376 |
| 375 void WebMediaPlayerImpl::DoLoad(LoadType load_type, | 377 void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
| 376 const blink::WebURL& url, | 378 const blink::WebURL& url, |
| 377 CORSMode cors_mode) { | 379 CORSMode cors_mode) { |
| (...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2295 | 2297 |
| 2296 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2298 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
| 2297 DCHECK(data_source_ || chunk_demuxer_); | 2299 DCHECK(data_source_ || chunk_demuxer_); |
| 2298 if (data_source_) | 2300 if (data_source_) |
| 2299 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2301 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
| 2300 else | 2302 else |
| 2301 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2303 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
| 2302 } | 2304 } |
| 2303 | 2305 |
| 2304 } // namespace media | 2306 } // namespace media |
| OLD | NEW |