| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 void WebMediaPlayerImpl::enteredFullscreen() { | 350 void WebMediaPlayerImpl::enteredFullscreen() { |
| 351 // |force_video_overlays_| implies that we're already in overlay mode, so take | 351 // |force_video_overlays_| implies that we're already in overlay mode, so take |
| 352 // no action here. Otherwise, switch to an overlay if it's allowed and if | 352 // no action here. Otherwise, switch to an overlay if it's allowed and if |
| 353 // it will display properly. | 353 // it will display properly. |
| 354 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ && | 354 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ && |
| 355 DoesOverlaySupportMetadata()) { | 355 DoesOverlaySupportMetadata()) { |
| 356 EnableOverlay(); | 356 EnableOverlay(); |
| 357 } | 357 } |
| 358 if (observer_) | 358 if (observer_) |
| 359 observer_->OnEnteredFullscreen(); | 359 observer_->OnEnteredFullscreen(); |
| 360 delegate_->SetIsFullscreen(delegate_id_, true); |
| 360 } | 361 } |
| 361 | 362 |
| 362 void WebMediaPlayerImpl::exitedFullscreen() { | 363 void WebMediaPlayerImpl::exitedFullscreen() { |
| 363 // If we're in overlay mode, then exit it unless we're supposed to be in | 364 // If we're in overlay mode, then exit it unless we're supposed to be in |
| 364 // overlay mode all the time. | 365 // overlay mode all the time. |
| 365 if (!force_video_overlays_ && overlay_enabled_) | 366 if (!force_video_overlays_ && overlay_enabled_) |
| 366 DisableOverlay(); | 367 DisableOverlay(); |
| 367 if (observer_) | 368 if (observer_) |
| 368 observer_->OnExitedFullscreen(); | 369 observer_->OnExitedFullscreen(); |
| 370 delegate_->SetIsFullscreen(delegate_id_, false); |
| 369 } | 371 } |
| 370 | 372 |
| 371 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) { | 373 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) { |
| 372 if (observer_) | 374 if (observer_) |
| 373 observer_->OnBecameDominantVisibleContent(isDominant); | 375 observer_->OnBecameDominantVisibleContent(isDominant); |
| 374 } | 376 } |
| 375 | 377 |
| 376 void WebMediaPlayerImpl::DoLoad(LoadType load_type, | 378 void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
| 377 const blink::WebURL& url, | 379 const blink::WebURL& url, |
| 378 CORSMode cors_mode) { | 380 CORSMode cors_mode) { |
| (...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2294 } | 2296 } |
| 2295 } | 2297 } |
| 2296 | 2298 |
| 2297 void WebMediaPlayerImpl::SwitchRenderer(bool disable_pipeline_auto_suspend) { | 2299 void WebMediaPlayerImpl::SwitchRenderer(bool disable_pipeline_auto_suspend) { |
| 2298 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 2300 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 2299 disable_pipeline_auto_suspend_ = disable_pipeline_auto_suspend; | 2301 disable_pipeline_auto_suspend_ = disable_pipeline_auto_suspend; |
| 2300 ScheduleRestart(); | 2302 ScheduleRestart(); |
| 2301 } | 2303 } |
| 2302 | 2304 |
| 2303 } // namespace media | 2305 } // namespace media |
| OLD | NEW |