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

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

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Addressed comments. Observe intersection changing. Created 4 years, 1 month 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 observer_->OnEnteredFullscreen(); 345 observer_->OnEnteredFullscreen();
346 } 346 }
347 347
348 void WebMediaPlayerImpl::exitedFullscreen() { 348 void WebMediaPlayerImpl::exitedFullscreen() {
349 if (!force_video_overlays_ && !disable_fullscreen_video_overlays_) 349 if (!force_video_overlays_ && !disable_fullscreen_video_overlays_)
350 DisableOverlay(); 350 DisableOverlay();
351 if (observer_) 351 if (observer_)
352 observer_->OnExitedFullscreen(); 352 observer_->OnExitedFullscreen();
353 } 353 }
354 354
355 void WebMediaPlayerImpl::videoViewportIntersectionChanged(
356 const blink::WebMediaPlayer::ViewportIntersectionInfo& info) {
357 MediaObserver::ViewportIntersectionInfo intersect_info;
358 intersect_info.ratio = info.ratio;
359 intersect_info.root_rect =
miu 2016/11/15 23:29:26 I think the types have implicit conversion defined
xjz 2016/11/16 01:06:45 Done.
360 gfx::Rect(info.rootRect.x, info.rootRect.y, info.rootRect.width,
361 info.rootRect.height);
362 intersect_info.intersect_rect =
363 gfx::Rect(info.intersectRect.x, info.intersectRect.y,
364 info.intersectRect.width, info.intersectRect.height);
365 if (observer_)
366 observer_->OnVideoViewportIntersectionChanged(intersect_info);
367 }
368
355 void WebMediaPlayerImpl::DoLoad(LoadType load_type, 369 void WebMediaPlayerImpl::DoLoad(LoadType load_type,
356 const blink::WebURL& url, 370 const blink::WebURL& url,
357 CORSMode cors_mode) { 371 CORSMode cors_mode) {
358 DVLOG(1) << __func__; 372 DVLOG(1) << __func__;
359 DCHECK(main_task_runner_->BelongsToCurrentThread()); 373 DCHECK(main_task_runner_->BelongsToCurrentThread());
360 374
361 GURL gurl(url); 375 GURL gurl(url);
362 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin()); 376 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin());
363 377
364 // Set subresource URL for crash reporting. 378 // Set subresource URL for crash reporting.
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 pipeline_metadata_.natural_size, 1907 pipeline_metadata_.natural_size,
1894 base::Bind(&GetCurrentTimeInternal, this))); 1908 base::Bind(&GetCurrentTimeInternal, this)));
1895 watch_time_reporter_->OnVolumeChange(volume_); 1909 watch_time_reporter_->OnVolumeChange(volume_);
1896 if (delegate_ && delegate_->IsHidden()) 1910 if (delegate_ && delegate_->IsHidden())
1897 watch_time_reporter_->OnHidden(); 1911 watch_time_reporter_->OnHidden();
1898 else 1912 else
1899 watch_time_reporter_->OnShown(); 1913 watch_time_reporter_->OnShown();
1900 } 1914 }
1901 1915
1902 } // namespace media 1916 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698