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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 2855843002: Reland "Sync requestFullscreen() and exitFullscreen() algorithms with the spec" (Closed)
Patch Set: Reland "Sync requestFullscreen() and exitFullscreen() algorithms with the spec" Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // This is only recorded when entering this mode. 249 // This is only recorded when entering this mode.
250 DEFINE_STATIC_LOCAL(EnumerationHistogram, histogram, 250 DEFINE_STATIC_LOCAL(EnumerationHistogram, histogram,
251 ("Media.VideoPersistence.ControlsType", 251 ("Media.VideoPersistence.ControlsType",
252 kVideoPersistenceControlsTypeCount)); 252 kVideoPersistenceControlsTypeCount));
253 if (IsFullscreen()) 253 if (IsFullscreen())
254 histogram.Count(kVideoPersistenceControlsTypeNative); 254 histogram.Count(kVideoPersistenceControlsTypeNative);
255 else 255 else
256 histogram.Count(kVideoPersistenceControlsTypeCustom); 256 histogram.Count(kVideoPersistenceControlsTypeCustom);
257 257
258 Element* fullscreen_element = 258 Element* fullscreen_element =
259 Fullscreen::CurrentFullScreenElementFrom(GetDocument()); 259 Fullscreen::FullscreenElementFrom(GetDocument());
260 // Only set the video in persistent mode if it is not using native controls 260 // Only set the video in persistent mode if it is not using native controls
261 // and is currently fullscreen. 261 // and is currently fullscreen.
262 if (!fullscreen_element || IsFullscreen()) 262 if (!fullscreen_element || IsFullscreen())
263 return; 263 return;
264 264
265 is_persistent_ = true; 265 is_persistent_ = true;
266 PseudoStateChanged(CSSSelector::kPseudoVideoPersistent); 266 PseudoStateChanged(CSSSelector::kPseudoVideoPersistent);
267 267
268 // The video is also marked as containing a persistent video to simplify the 268 // The video is also marked as containing a persistent video to simplify the
269 // internal CSS logic. 269 // internal CSS logic.
270 for (Element* element = this; element && element != fullscreen_element; 270 for (Element* element = this; element && element != fullscreen_element;
271 element = element->ParentOrShadowHostElement()) { 271 element = element->ParentOrShadowHostElement()) {
272 element->SetContainsPersistentVideo(true); 272 element->SetContainsPersistentVideo(true);
273 } 273 }
274 fullscreen_element->SetContainsPersistentVideo(true); 274 fullscreen_element->SetContainsPersistentVideo(true);
275 } else { 275 } else {
276 if (!is_persistent_) 276 if (!is_persistent_)
277 return; 277 return;
278 278
279 is_persistent_ = false; 279 is_persistent_ = false;
280 PseudoStateChanged(CSSSelector::kPseudoVideoPersistent); 280 PseudoStateChanged(CSSSelector::kPseudoVideoPersistent);
281 281
282 Element* fullscreen_element = 282 Element* fullscreen_element =
283 Fullscreen::CurrentFullScreenElementFrom(GetDocument()); 283 Fullscreen::FullscreenElementFrom(GetDocument());
284 // If the page is no longer fullscreen, the full tree will have to be 284 // If the page is no longer fullscreen, the full tree will have to be
285 // traversed to make sure things are cleaned up. 285 // traversed to make sure things are cleaned up.
286 for (Element* element = this; element && element != fullscreen_element; 286 for (Element* element = this; element && element != fullscreen_element;
287 element = element->ParentOrShadowHostElement()) { 287 element = element->ParentOrShadowHostElement()) {
288 element->SetContainsPersistentVideo(false); 288 element->SetContainsPersistentVideo(false);
289 } 289 }
290 if (fullscreen_element) 290 if (fullscreen_element)
291 fullscreen_element->SetContainsPersistentVideo(false); 291 fullscreen_element->SetContainsPersistentVideo(false);
292 } 292 }
293 } 293 }
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 remoting_interstitial_->Hide(); 521 remoting_interstitial_->Hide();
522 } 522 }
523 523
524 void HTMLVideoElement::DisableMediaRemoting() { 524 void HTMLVideoElement::DisableMediaRemoting() {
525 media_remoting_status_ = MediaRemotingStatus::kDisabled; 525 media_remoting_status_ = MediaRemotingStatus::kDisabled;
526 if (GetWebMediaPlayer()) 526 if (GetWebMediaPlayer())
527 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); 527 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true);
528 } 528 }
529 529
530 } // namespace blink 530 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698