| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |