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: third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegate.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 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "modules/media_controls/MediaControlsRotateToFullscreenDelegate.h" 5 #include "modules/media_controls/MediaControlsRotateToFullscreenDelegate.h"
6 6
7 #include "core/dom/DocumentUserGestureToken.h" 7 #include "core/dom/DocumentUserGestureToken.h"
8 #include "core/dom/ElementVisibilityObserver.h" 8 #include "core/dom/ElementVisibilityObserver.h"
9 #include "core/dom/Fullscreen.h" 9 #include "core/dom/Fullscreen.h"
10 #include "core/events/Event.h" 10 #include "core/events/Event.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return; 160 return;
161 } 161 }
162 162
163 // Ignore 180 degree rotations between PortraitPrimary and PortraitSecondary, 163 // Ignore 180 degree rotations between PortraitPrimary and PortraitSecondary,
164 // or between LandscapePrimary and LandscapeSecondary. 164 // or between LandscapePrimary and LandscapeSecondary.
165 if (previous_screen_orientation == current_screen_orientation_) 165 if (previous_screen_orientation == current_screen_orientation_)
166 return; 166 return;
167 167
168 SimpleOrientation video_orientation = ComputeVideoOrientation(); 168 SimpleOrientation video_orientation = ComputeVideoOrientation();
169 169
170 // Ignore videos that are square/small/etc. 170 // Ignore videos that are too small or of unknown size.
171 if (video_orientation == SimpleOrientation::kUnknown) 171 if (video_orientation == SimpleOrientation::kUnknown)
172 return; 172 return;
173 173
174 MediaControlsImpl& media_controls = 174 MediaControlsImpl& media_controls =
175 *static_cast<MediaControlsImpl*>(video_element_->GetMediaControls()); 175 *static_cast<MediaControlsImpl*>(video_element_->GetMediaControls());
176 176
177 { 177 {
178 UserGestureIndicator gesture( 178 UserGestureIndicator gesture(
179 DocumentUserGestureToken::Create(&video_element_->GetDocument())); 179 DocumentUserGestureToken::Create(&video_element_->GetDocument()));
180 180
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 return SimpleOrientation::kUnknown; 224 return SimpleOrientation::kUnknown;
225 } 225 }
226 226
227 DEFINE_TRACE(MediaControlsRotateToFullscreenDelegate) { 227 DEFINE_TRACE(MediaControlsRotateToFullscreenDelegate) {
228 EventListener::Trace(visitor); 228 EventListener::Trace(visitor);
229 visitor->Trace(video_element_); 229 visitor->Trace(video_element_);
230 visitor->Trace(visibility_observer_); 230 visitor->Trace(visibility_observer_);
231 } 231 }
232 232
233 } // namespace blink 233 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698