| 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.
h" | 5 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host.
h" |
| 6 | 6 |
| 7 #include "content/browser/screen_orientation/screen_orientation_provider.h" | 7 #include "content/browser/screen_orientation/screen_orientation_provider.h" |
| 8 #include "content/common/screen_orientation_messages.h" | 8 #include "content/common/screen_orientation_messages.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return RenderFrameHost::FromID(current_lock_->process_id, | 64 return RenderFrameHost::FromID(current_lock_->process_id, |
| 65 current_lock_->routing_id); | 65 current_lock_->routing_id); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void ScreenOrientationDispatcherHost::NotifyLockSuccess(int request_id) { | 68 void ScreenOrientationDispatcherHost::NotifyLockSuccess(int request_id) { |
| 69 RenderFrameHost* render_frame_host = | 69 RenderFrameHost* render_frame_host = |
| 70 GetRenderFrameHostForRequestID(request_id); | 70 GetRenderFrameHostForRequestID(request_id); |
| 71 if (!render_frame_host) | 71 if (!render_frame_host) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 DCHECK(web_contents()->GetRenderViewHost()); | |
| 75 | |
| 76 RenderWidgetHost* rwh = web_contents()->GetRenderViewHost(); | |
| 77 blink::WebScreenInfo screen_info; | |
| 78 rwh->GetWebScreenInfo(&screen_info); | |
| 79 | |
| 80 render_frame_host->Send(new ScreenOrientationMsg_LockSuccess( | 74 render_frame_host->Send(new ScreenOrientationMsg_LockSuccess( |
| 81 render_frame_host->GetRoutingID(), | 75 render_frame_host->GetRoutingID(), request_id)); |
| 82 request_id, | |
| 83 screen_info.orientationAngle, | |
| 84 screen_info.orientationType)); | |
| 85 ResetCurrentLock(); | 76 ResetCurrentLock(); |
| 86 } | 77 } |
| 87 | 78 |
| 88 void ScreenOrientationDispatcherHost::NotifyLockError( | 79 void ScreenOrientationDispatcherHost::NotifyLockError( |
| 89 int request_id, blink::WebLockOrientationError error) { | 80 int request_id, blink::WebLockOrientationError error) { |
| 90 RenderFrameHost* render_frame_host = | 81 RenderFrameHost* render_frame_host = |
| 91 GetRenderFrameHostForRequestID(request_id); | 82 GetRenderFrameHostForRequestID(request_id); |
| 92 if (!render_frame_host) | 83 if (!render_frame_host) |
| 93 return; | 84 return; |
| 94 | 85 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 blink::WebLockOrientationErrorCanceled); | 122 blink::WebLockOrientationErrorCanceled); |
| 132 } | 123 } |
| 133 | 124 |
| 134 if (!provider_.get()) | 125 if (!provider_.get()) |
| 135 return; | 126 return; |
| 136 | 127 |
| 137 provider_->UnlockOrientation(); | 128 provider_->UnlockOrientation(); |
| 138 } | 129 } |
| 139 | 130 |
| 140 } // namespace content | 131 } // namespace content |
| OLD | NEW |