| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/MediaControlsOrientationLockDelegate.h" | 5 #include "modules/media_controls/MediaControlsOrientationLockDelegate.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/DocumentUserGestureToken.h" | 8 #include "core/dom/DocumentUserGestureToken.h" |
| 9 #include "core/dom/Fullscreen.h" | 9 #include "core/dom/Fullscreen.h" |
| 10 #include "core/frame/ScreenOrientationController.h" | 10 #include "core/frame/ScreenOrientationController.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 MediaControls()->orientation_lock_delegate_->state_); | 181 MediaControls()->orientation_lock_delegate_->state_); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void CheckStateMaybeLockedFullscreen() const { | 184 void CheckStateMaybeLockedFullscreen() const { |
| 185 EXPECT_EQ( | 185 EXPECT_EQ( |
| 186 MediaControlsOrientationLockDelegate::State::kMaybeLockedFullscreen, | 186 MediaControlsOrientationLockDelegate::State::kMaybeLockedFullscreen, |
| 187 MediaControls()->orientation_lock_delegate_->state_); | 187 MediaControls()->orientation_lock_delegate_->state_); |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool DelegateWillUnlockFullscreen() const { | 190 bool DelegateWillUnlockFullscreen() const { |
| 191 return MediaControls() | 191 return MediaControls()->orientation_lock_delegate_->locked_orientation_ != |
| 192 ->orientation_lock_delegate_->should_unlock_orientation_; | 192 kWebScreenOrientationLockDefault /* unlocked */; |
| 193 } | 193 } |
| 194 | 194 |
| 195 WebScreenOrientationLockType ComputeOrientationLock() const { | 195 WebScreenOrientationLockType ComputeOrientationLock() const { |
| 196 return MediaControls() | 196 return MediaControls() |
| 197 ->orientation_lock_delegate_->ComputeOrientationLock(); | 197 ->orientation_lock_delegate_->ComputeOrientationLock(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 MockChromeClient& ChromeClient() const { return *chrome_client_; } | 200 MockChromeClient& ChromeClient() const { return *chrome_client_; } |
| 201 | 201 |
| 202 HTMLVideoElement& Video() const { return *video_; } | 202 HTMLVideoElement& Video() const { return *video_; } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 EXPECT_EQ(kWebScreenOrientationLockLandscape, ComputeOrientationLock()); | 396 EXPECT_EQ(kWebScreenOrientationLockLandscape, ComputeOrientationLock()); |
| 397 | 397 |
| 398 screen_info.orientation_type = kWebScreenOrientationLandscapeSecondary; | 398 screen_info.orientation_type = kWebScreenOrientationLandscapeSecondary; |
| 399 EXPECT_CALL(ChromeClient(), GetScreenInfo()) | 399 EXPECT_CALL(ChromeClient(), GetScreenInfo()) |
| 400 .Times(1) | 400 .Times(1) |
| 401 .WillOnce(Return(screen_info)); | 401 .WillOnce(Return(screen_info)); |
| 402 EXPECT_EQ(kWebScreenOrientationLockLandscape, ComputeOrientationLock()); | 402 EXPECT_EQ(kWebScreenOrientationLockLandscape, ComputeOrientationLock()); |
| 403 } | 403 } |
| 404 | 404 |
| 405 } // namespace blink | 405 } // namespace blink |
| OLD | NEW |