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

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

Issue 2511143006: Detect change on the intersection of video and viewport. (Closed)
Patch Set: 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 observer_->OnEnteredFullscreen(); 354 observer_->OnEnteredFullscreen();
355 } 355 }
356 356
357 void WebMediaPlayerImpl::exitedFullscreen() { 357 void WebMediaPlayerImpl::exitedFullscreen() {
358 if (!force_video_overlays_ && !disable_fullscreen_video_overlays_) 358 if (!force_video_overlays_ && !disable_fullscreen_video_overlays_)
359 DisableOverlay(); 359 DisableOverlay();
360 if (observer_) 360 if (observer_)
361 observer_->OnExitedFullscreen(); 361 observer_->OnExitedFullscreen();
362 } 362 }
363 363
364 void WebMediaPlayerImpl::videoViewportIntersectionChanged(
365 const blink::WebMediaPlayer::ViewportIntersectionInfo& info) {
366 MediaObserver::ViewportIntersectionInfo intersect_info;
367 intersect_info.root_rect = info.rootRect;
368 intersect_info.intersect_rect = info.intersectRect;
369 if (observer_)
370 observer_->OnVideoViewportIntersectionChanged(intersect_info);
371 }
372
364 void WebMediaPlayerImpl::DoLoad(LoadType load_type, 373 void WebMediaPlayerImpl::DoLoad(LoadType load_type,
365 const blink::WebURL& url, 374 const blink::WebURL& url,
366 CORSMode cors_mode) { 375 CORSMode cors_mode) {
367 DVLOG(1) << __func__; 376 DVLOG(1) << __func__;
368 DCHECK(main_task_runner_->BelongsToCurrentThread()); 377 DCHECK(main_task_runner_->BelongsToCurrentThread());
369 378
370 GURL gurl(url); 379 GURL gurl(url);
371 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin()); 380 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin());
372 381
373 // Set subresource URL for crash reporting. 382 // Set subresource URL for crash reporting.
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 pipeline_metadata_.natural_size, 1964 pipeline_metadata_.natural_size,
1956 base::Bind(&GetCurrentTimeInternal, this))); 1965 base::Bind(&GetCurrentTimeInternal, this)));
1957 watch_time_reporter_->OnVolumeChange(volume_); 1966 watch_time_reporter_->OnVolumeChange(volume_);
1958 if (delegate_ && delegate_->IsHidden()) 1967 if (delegate_ && delegate_->IsHidden())
1959 watch_time_reporter_->OnHidden(); 1968 watch_time_reporter_->OnHidden();
1960 else 1969 else
1961 watch_time_reporter_->OnShown(); 1970 watch_time_reporter_->OnShown();
1962 } 1971 }
1963 1972
1964 } // namespace media 1973 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698