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

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: 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
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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 void WebMediaPlayerImpl::enteredFullscreen() { 347 void WebMediaPlayerImpl::enteredFullscreen() {
348 // |force_video_overlays_| implies that we're already in overlay mode, so take 348 // |force_video_overlays_| implies that we're already in overlay mode, so take
349 // no action here. Otherwise, switch to an overlay if it's allowed and if 349 // no action here. Otherwise, switch to an overlay if it's allowed and if
350 // it will display properly. 350 // it will display properly.
351 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ && 351 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ &&
352 DoesOverlaySupportMetadata()) { 352 DoesOverlaySupportMetadata()) {
353 EnableOverlay(); 353 EnableOverlay();
354 } 354 }
355 if (observer_) 355 if (observer_)
356 observer_->OnEnteredFullscreen(); 356 observer_->OnEnteredFullscreen();
357 delegate_->SetIsFullscreen(delegate_id_, true);
357 } 358 }
358 359
359 void WebMediaPlayerImpl::exitedFullscreen() { 360 void WebMediaPlayerImpl::exitedFullscreen() {
360 // If we're in overlay mode, then exit it unless we're supposed to be in 361 // If we're in overlay mode, then exit it unless we're supposed to be in
361 // overlay mode all the time. 362 // overlay mode all the time.
362 if (!force_video_overlays_ && overlay_enabled_) 363 if (!force_video_overlays_ && overlay_enabled_)
363 DisableOverlay(); 364 DisableOverlay();
364 if (observer_) 365 if (observer_)
365 observer_->OnExitedFullscreen(); 366 observer_->OnExitedFullscreen();
367 delegate_->SetIsFullscreen(delegate_id_, false);
366 } 368 }
367 369
368 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) { 370 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) {
369 if (observer_) 371 if (observer_)
370 observer_->OnBecameDominantVisibleContent(isDominant); 372 observer_->OnBecameDominantVisibleContent(isDominant);
373 delegate_->SetIsDominant(delegate_id_, isDominant);
371 } 374 }
372 375
373 void WebMediaPlayerImpl::DoLoad(LoadType load_type, 376 void WebMediaPlayerImpl::DoLoad(LoadType load_type,
374 const blink::WebURL& url, 377 const blink::WebURL& url,
375 CORSMode cors_mode) { 378 CORSMode cors_mode) {
376 DVLOG(1) << __func__; 379 DVLOG(1) << __func__;
377 DCHECK(main_task_runner_->BelongsToCurrentThread()); 380 DCHECK(main_task_runner_->BelongsToCurrentThread());
378 381
379 GURL gurl(url); 382 GURL gurl(url);
380 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin()); 383 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin());
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 UMA_HISTOGRAM_TIMES( 2288 UMA_HISTOGRAM_TIMES(
2286 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", 2289 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack",
2287 time_to_first_frame); 2290 time_to_first_frame);
2288 } else { 2291 } else {
2289 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", 2292 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused",
2290 time_to_first_frame); 2293 time_to_first_frame);
2291 } 2294 }
2292 } 2295 }
2293 2296
2294 } // namespace media 2297 } // namespace media
OLDNEW
« content/browser/web_contents/web_contents_impl.h ('K') | « media/blink/webmediaplayer_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698