| Index: content/browser/screen_orientation/screen_orientation.cc
|
| diff --git a/content/browser/screen_orientation/screen_orientation.cc b/content/browser/screen_orientation/screen_orientation.cc
|
| index a7e0ad9462a8310f94922710bda4fd7a107c6c62..98daf1cbadd8f233bcfe56a1098af330317a819d 100644
|
| --- a/content/browser/screen_orientation/screen_orientation.cc
|
| +++ b/content/browser/screen_orientation/screen_orientation.cc
|
| @@ -4,16 +4,12 @@
|
|
|
| #include "content/browser/screen_orientation/screen_orientation.h"
|
|
|
| -#include "base/bind.h"
|
| -#include "base/callback_helpers.h"
|
| #include "content/public/browser/navigation_details.h"
|
| #include "content/public/browser/screen_orientation_provider.h"
|
| #include "content/public/browser/web_contents.h"
|
|
|
| namespace content {
|
|
|
| -using LockResult = device::mojom::ScreenOrientationLockResult;
|
| -
|
| ScreenOrientation::ScreenOrientation(WebContents* web_contents)
|
| : WebContentsObserver(web_contents),
|
| bindings_(web_contents, this),
|
| @@ -26,21 +22,10 @@ ScreenOrientation::~ScreenOrientation() = default;
|
| void ScreenOrientation::LockOrientation(
|
| blink::WebScreenOrientationLockType orientation,
|
| const LockOrientationCallback& callback) {
|
| - if (!on_result_callback_.is_null()) {
|
| - NotifyLockResult(LockResult::SCREEN_ORIENTATION_LOCK_RESULT_ERROR_CANCELED);
|
| - }
|
| -
|
| - on_result_callback_ = callback;
|
| -
|
| - provider_->LockOrientation(
|
| - orientation,
|
| - base::Bind(&ScreenOrientation::NotifyLockResult, base::Unretained(this)));
|
| + provider_->LockOrientation(orientation, callback);
|
| }
|
|
|
| void ScreenOrientation::UnlockOrientation() {
|
| - // Cancel any pending lock request.
|
| - NotifyLockResult(LockResult::SCREEN_ORIENTATION_LOCK_RESULT_ERROR_CANCELED);
|
| -
|
| provider_->UnlockOrientation();
|
| }
|
|
|
| @@ -52,13 +37,6 @@ void ScreenOrientation::DidNavigateMainFrame(
|
| provider_->UnlockOrientation();
|
| }
|
|
|
| -void ScreenOrientation::NotifyLockResult(LockResult result) {
|
| - if (on_result_callback_.is_null())
|
| - return;
|
| -
|
| - base::ResetAndReturn(&on_result_callback_).Run(result);
|
| -}
|
| -
|
| ScreenOrientationProvider* ScreenOrientation::GetScreenOrientationProvider() {
|
| return provider_.get();
|
| }
|
|
|