Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: content/public/browser/screen_orientation_provider.cc

Issue 648733003: Implement ScreenOrientationDelegate on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698