Chromium Code Reviews| Index: content/public/browser/screen_orientation_provider.cc |
| diff --git a/content/public/browser/screen_orientation_provider.cc b/content/public/browser/screen_orientation_provider.cc |
| index 35a07eeffde67319a00fca785cc50b72d335372c..3336cdff840ff2a7404c108065e5a070da61964d 100644 |
| --- a/content/public/browser/screen_orientation_provider.cc |
| +++ b/content/public/browser/screen_orientation_provider.cc |
| @@ -72,8 +72,13 @@ void ScreenOrientationProvider::LockOrientation(int request_id, |
| } |
| } |
| - lock_applied_ = true; |
| - delegate_->Lock(lock_orientation); |
| + lock_applied_ = delegate_->Lock(web_contents(), lock_orientation); |
|
mlamouri (slow - plz ping)
2014/11/01 00:30:40
I'm really uncomfortable with that change especial
jonross
2014/11/03 18:22:03
That SGTM.
I'll reset the delegate to always Lock
|
| + if (!lock_applied_) { |
| + // The delegate was unable to lock, cancel. |
| + dispatcher_->NotifyLockError(request_id, |
| + blink::WebLockOrientationErrorCanceled); |
| + return; |
| + } |
| // If two calls happen close to each other some platforms will ignore the |
| // first. A successful lock will be once orientation matches the latest |
| @@ -94,7 +99,7 @@ void ScreenOrientationProvider::UnlockOrientation() { |
| if (!lock_applied_ || !delegate_) |
| return; |
| - delegate_->Unlock(); |
| + delegate_->Unlock(web_contents()); |
| lock_applied_ = false; |
| pending_lock_.reset(); |