Commit 34841110 authored by mlamouri's avatar mlamouri Committed by Commit bot

Explicitely unlock screen orientation when navigating.

BUG=162827

Review URL: https://codereview.chromium.org/582373003

Cr-Commit-Position: refs/heads/master@{#295692}
parent 70647c61
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h" #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h"
#include "content/common/screen_orientation_messages.h" #include "content/common/screen_orientation_messages.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
...@@ -55,6 +56,13 @@ bool ScreenOrientationDispatcherHostImpl::OnMessageReceived( ...@@ -55,6 +56,13 @@ bool ScreenOrientationDispatcherHostImpl::OnMessageReceived(
return handled; return handled;
} }
void ScreenOrientationDispatcherHostImpl::DidNavigateMainFrame(
const LoadCommittedDetails& details, const FrameNavigateParams& params) {
if (!provider_ || details.is_in_page)
return;
provider_->UnlockOrientation();
}
RenderFrameHost* RenderFrameHost*
ScreenOrientationDispatcherHostImpl::GetRenderFrameHostForRequestID( ScreenOrientationDispatcherHostImpl::GetRenderFrameHostForRequestID(
int request_id) { int request_id) {
......
...@@ -35,6 +35,8 @@ class CONTENT_EXPORT ScreenOrientationDispatcherHostImpl ...@@ -35,6 +35,8 @@ class CONTENT_EXPORT ScreenOrientationDispatcherHostImpl
// WebContentsObserver: // WebContentsObserver:
virtual bool OnMessageReceived(const IPC::Message&, virtual bool OnMessageReceived(const IPC::Message&,
RenderFrameHost* render_frame_host) OVERRIDE; RenderFrameHost* render_frame_host) OVERRIDE;
virtual void DidNavigateMainFrame(const LoadCommittedDetails& details,
const FrameNavigateParams& params) OVERRIDE;
private: private:
void OnLockRequest(RenderFrameHost* render_frame_host, void OnLockRequest(RenderFrameHost* render_frame_host,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment