| Index: content/renderer/screen_orientation/screen_orientation_dispatcher.cc
|
| diff --git a/content/renderer/screen_orientation/screen_orientation_dispatcher.cc b/content/renderer/screen_orientation/screen_orientation_dispatcher.cc
|
| index 748aca844c624f4abbeebcb3805bf87d3a162b1c..8591fa363555844074010fc1d76bf40e3520ebd5 100644
|
| --- a/content/renderer/screen_orientation/screen_orientation_dispatcher.cc
|
| +++ b/content/renderer/screen_orientation/screen_orientation_dispatcher.cc
|
| @@ -69,8 +69,7 @@ void ScreenOrientationDispatcher::lockOrientation(
|
| CancelPendingLocks();
|
|
|
| int request_id = pending_callbacks_.Add(std::move(callback));
|
| - EnsureScreenOrientationService();
|
| - screen_orientation_->LockOrientation(
|
| + GetRemoteScreenOrientation()->LockOrientation(
|
| orientation,
|
| base::Bind(&ScreenOrientationDispatcher::OnLockOrientationResult,
|
| base::Unretained(this), request_id));
|
| @@ -78,15 +77,25 @@ void ScreenOrientationDispatcher::lockOrientation(
|
|
|
| void ScreenOrientationDispatcher::unlockOrientation() {
|
| CancelPendingLocks();
|
| - EnsureScreenOrientationService();
|
| - screen_orientation_->UnlockOrientation();
|
| + GetRemoteScreenOrientation()->UnlockOrientation();
|
| }
|
|
|
| -void ScreenOrientationDispatcher::EnsureScreenOrientationService() {
|
| +void ScreenOrientationDispatcher::startAccurateListen() {
|
| + GetRemoteScreenOrientation()->StartAccurateListen();
|
| +}
|
| +
|
| +void ScreenOrientationDispatcher::stopAccurateListen() {
|
| + GetRemoteScreenOrientation()->StopAccurateListen();
|
| +}
|
| +
|
| +device::mojom::ScreenOrientation*
|
| +ScreenOrientationDispatcher::GetRemoteScreenOrientation() {
|
| if (!screen_orientation_) {
|
| render_frame()->GetRemoteAssociatedInterfaces()->GetInterface(
|
| &screen_orientation_);
|
| }
|
| +
|
| + return screen_orientation_.get();
|
| }
|
|
|
| int ScreenOrientationDispatcher::GetRequestIdForTests() {
|
|
|