Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 2693203002: Provide a WebContents API to discover the playback of a fullscreen video. (Closed)
Patch Set: apply review comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/webmediaplayer_delegate.h ('k') | media/blink/webmediaplayer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_delegate.h ('k') | media/blink/webmediaplayer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698