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

Side by Side Diff: content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.cc

Issue 582373003: Explicitely unlock screen orientation when navigating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h" 5 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h"
6 6
7 #include "content/common/screen_orientation_messages.h" 7 #include "content/common/screen_orientation_messages.h"
8 #include "content/public/browser/navigation_details.h"
8 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
9 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
10 #include "content/public/browser/render_view_host.h" 11 #include "content/public/browser/render_view_host.h"
11 #include "content/public/browser/render_widget_host.h" 12 #include "content/public/browser/render_widget_host.h"
12 #include "content/public/browser/screen_orientation_provider.h" 13 #include "content/public/browser/screen_orientation_provider.h"
13 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
14 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 15 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
15 16
16 namespace content { 17 namespace content {
17 18
(...skipping 30 matching lines...) Expand all
48 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(ScreenOrientationDispatcherHostImpl, message, 49 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(ScreenOrientationDispatcherHostImpl, message,
49 render_frame_host) 50 render_frame_host)
50 IPC_MESSAGE_HANDLER(ScreenOrientationHostMsg_LockRequest, OnLockRequest) 51 IPC_MESSAGE_HANDLER(ScreenOrientationHostMsg_LockRequest, OnLockRequest)
51 IPC_MESSAGE_HANDLER(ScreenOrientationHostMsg_Unlock, OnUnlockRequest) 52 IPC_MESSAGE_HANDLER(ScreenOrientationHostMsg_Unlock, OnUnlockRequest)
52 IPC_MESSAGE_UNHANDLED(handled = false) 53 IPC_MESSAGE_UNHANDLED(handled = false)
53 IPC_END_MESSAGE_MAP() 54 IPC_END_MESSAGE_MAP()
54 55
55 return handled; 56 return handled;
56 } 57 }
57 58
59 void ScreenOrientationDispatcherHostImpl::DidNavigateMainFrame(
60 const LoadCommittedDetails& details, const FrameNavigateParams& params) {
61 if (!provider_ || details.is_in_page)
62 return;
63 provider_->UnlockOrientation();
64 }
65
58 RenderFrameHost* 66 RenderFrameHost*
59 ScreenOrientationDispatcherHostImpl::GetRenderFrameHostForRequestID( 67 ScreenOrientationDispatcherHostImpl::GetRenderFrameHostForRequestID(
60 int request_id) { 68 int request_id) {
61 if (!current_lock_ || current_lock_->request_id != request_id) 69 if (!current_lock_ || current_lock_->request_id != request_id)
62 return NULL; 70 return NULL;
63 71
64 return RenderFrameHost::FromID(current_lock_->process_id, 72 return RenderFrameHost::FromID(current_lock_->process_id,
65 current_lock_->routing_id); 73 current_lock_->routing_id);
66 } 74 }
67 75
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 blink::WebLockOrientationErrorCanceled); 137 blink::WebLockOrientationErrorCanceled);
130 } 138 }
131 139
132 if (!provider_) 140 if (!provider_)
133 return; 141 return;
134 142
135 provider_->UnlockOrientation(); 143 provider_->UnlockOrientation();
136 } 144 }
137 145
138 } // namespace content 146 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698