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

Unified Diff: content/browser/screen_orientation/screen_orientation_dispatcher_host.cc

Issue 444033002: Fix screen.orientation.lock() rejection and an integration test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years, 4 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/browser/screen_orientation/screen_orientation_dispatcher_host.cc
diff --git a/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc b/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc
index 787228d1d003154f8eeab03e09e53d76cacdbf25..5d77d6c88958a53857c1f404cc415da2cebc97b1 100644
--- a/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc
+++ b/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc
@@ -83,6 +83,13 @@ void ScreenOrientationDispatcherHost::NotifyLockError(
if (!render_frame_host)
return;
+ NotifyLockError(request_id, render_frame_host, error);
+}
+
+void ScreenOrientationDispatcherHost::NotifyLockError(
+ int request_id,
+ RenderFrameHost* render_frame_host,
+ blink::WebLockOrientationError error) {
render_frame_host->Send(new ScreenOrientationMsg_LockError(
render_frame_host->GetRoutingID(), request_id, error));
ResetCurrentLock();
@@ -98,12 +105,12 @@ void ScreenOrientationDispatcherHost::OnLockRequest(
blink::WebScreenOrientationLockType orientation,
int request_id) {
if (current_lock_) {
- NotifyLockError(current_lock_->request_id,
+ NotifyLockError(current_lock_->request_id, render_frame_host,
blink::WebLockOrientationErrorCanceled);
}
if (!provider_) {
- NotifyLockError(request_id,
+ NotifyLockError(request_id, render_frame_host,
blink::WebLockOrientationErrorNotAvailable);
return;
}
@@ -118,7 +125,7 @@ void ScreenOrientationDispatcherHost::OnLockRequest(
void ScreenOrientationDispatcherHost::OnUnlockRequest(
RenderFrameHost* render_frame_host) {
if (current_lock_) {
- NotifyLockError(current_lock_->request_id,
+ NotifyLockError(current_lock_->request_id, render_frame_host,
blink::WebLockOrientationErrorCanceled);
}

Powered by Google App Engine
This is Rietveld 408576698