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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp

Issue 2890423003: [Media controls] Integrate rotate-to-fullscreen with orientation lock (Closed)
Patch Set: #undef atan2,fmod Created 3 years, 7 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) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 resize_observer_->observe(&media_element); 306 resize_observer_->observe(&media_element);
307 } 307 }
308 308
309 MediaControlsImpl* MediaControlsImpl::Create(HTMLMediaElement& media_element, 309 MediaControlsImpl* MediaControlsImpl::Create(HTMLMediaElement& media_element,
310 ShadowRoot& shadow_root) { 310 ShadowRoot& shadow_root) {
311 MediaControlsImpl* controls = new MediaControlsImpl(media_element); 311 MediaControlsImpl* controls = new MediaControlsImpl(media_element);
312 controls->SetShadowPseudoId(AtomicString("-webkit-media-controls")); 312 controls->SetShadowPseudoId(AtomicString("-webkit-media-controls"));
313 controls->InitializeControls(); 313 controls->InitializeControls();
314 controls->Reset(); 314 controls->Reset();
315 315
316 // RotateToFullscreen and FullscreenOrientationLock are not yet compatible 316 if (RuntimeEnabledFeatures::videoFullscreenOrientationLockEnabled() &&
317 // so enabling RotateToFullscreen disables FullscreenOrientationLock. 317 media_element.IsHTMLVideoElement()) {
318 // TODO(johnme): Make it possible to use both features simultaneously. 318 // Initialize the orientation lock when going fullscreen feature.
319 controls->orientation_lock_delegate_ =
320 new MediaControlsOrientationLockDelegate(
321 toHTMLVideoElement(media_element));
322 }
319 if (RuntimeEnabledFeatures::videoRotateToFullscreenEnabled() && 323 if (RuntimeEnabledFeatures::videoRotateToFullscreenEnabled() &&
320 media_element.IsHTMLVideoElement()) { 324 media_element.IsHTMLVideoElement()) {
321 // Initialize the rotate-to-fullscreen feature. 325 // Initialize the rotate-to-fullscreen feature.
322 controls->rotate_to_fullscreen_delegate_ = 326 controls->rotate_to_fullscreen_delegate_ =
323 new MediaControlsRotateToFullscreenDelegate( 327 new MediaControlsRotateToFullscreenDelegate(
324 toHTMLVideoElement(media_element)); 328 toHTMLVideoElement(media_element));
325 } else if (RuntimeEnabledFeatures::videoFullscreenOrientationLockEnabled() &&
326 media_element.IsHTMLVideoElement()) {
327 // Initialize the orientation lock when going fullscreen feature.
328 controls->orientation_lock_delegate_ =
329 new MediaControlsOrientationLockDelegate(
330 toHTMLVideoElement(media_element));
331 } 329 }
332 330
333 shadow_root.AppendChild(controls); 331 shadow_root.AppendChild(controls);
334 return controls; 332 return controls;
335 } 333 }
336 334
337 // The media controls DOM structure looks like: 335 // The media controls DOM structure looks like:
338 // 336 //
339 // MediaControlsImpl 337 // MediaControlsImpl
340 // (-webkit-media-controls) 338 // (-webkit-media-controls)
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 visitor->Trace(overlay_cast_button_); 1215 visitor->Trace(overlay_cast_button_);
1218 visitor->Trace(media_event_listener_); 1216 visitor->Trace(media_event_listener_);
1219 visitor->Trace(window_event_listener_); 1217 visitor->Trace(window_event_listener_);
1220 visitor->Trace(orientation_lock_delegate_); 1218 visitor->Trace(orientation_lock_delegate_);
1221 visitor->Trace(rotate_to_fullscreen_delegate_); 1219 visitor->Trace(rotate_to_fullscreen_delegate_);
1222 MediaControls::Trace(visitor); 1220 MediaControls::Trace(visitor);
1223 HTMLDivElement::Trace(visitor); 1221 HTMLDivElement::Trace(visitor);
1224 } 1222 }
1225 1223
1226 } // namespace blink 1224 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698