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/public/browser/screen_orientation_provider.h" | 5 #include "content/public/browser/screen_orientation_provider.h" |
6 | 6 |
7 #include "content/browser/renderer_host/render_view_host_impl.h" | 7 #include "content/browser/renderer_host/render_view_host_impl.h" |
8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
9 #include "content/public/browser/render_widget_host.h" | 9 #include "content/public/browser/render_widget_host.h" |
10 #include "content/public/browser/screen_orientation_delegate.h" | 10 #include "content/public/browser/screen_orientation_delegate.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 if (delegate_->FullScreenRequired(web_contents())) { | 46 if (delegate_->FullScreenRequired(web_contents())) { |
47 RenderViewHostImpl* rvhi = | 47 RenderViewHostImpl* rvhi = |
48 static_cast<RenderViewHostImpl*>(web_contents()->GetRenderViewHost()); | 48 static_cast<RenderViewHostImpl*>(web_contents()->GetRenderViewHost()); |
49 if (!rvhi) { | 49 if (!rvhi) { |
50 dispatcher_->NotifyLockError(request_id, | 50 dispatcher_->NotifyLockError(request_id, |
51 blink::WebLockOrientationErrorCanceled); | 51 blink::WebLockOrientationErrorCanceled); |
52 return; | 52 return; |
53 } | 53 } |
54 if (!static_cast<WebContentsImpl*>(web_contents()) | 54 if (!static_cast<WebContentsImpl*>(web_contents()) |
55 ->IsFullscreenForCurrentTab(rvhi->GetWidget())) { | 55 ->IsFullscreenForCurrentTab()) { |
56 dispatcher_->NotifyLockError(request_id, | 56 dispatcher_->NotifyLockError(request_id, |
57 blink::WebLockOrientationErrorFullScreenRequired); | 57 blink::WebLockOrientationErrorFullScreenRequired); |
58 return; | 58 return; |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 if (lock_orientation == blink::WebScreenOrientationLockNatural) { | 62 if (lock_orientation == blink::WebScreenOrientationLockNatural) { |
63 lock_orientation = GetNaturalLockType(); | 63 lock_orientation = GetNaturalLockType(); |
64 if (lock_orientation == blink::WebScreenOrientationLockDefault) { | 64 if (lock_orientation == blink::WebScreenOrientationLockDefault) { |
65 // We are in a broken state, let's pretend we got canceled. | 65 // We are in a broken state, let's pretend we got canceled. |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 case blink::WebScreenOrientationLockDefault: | 197 case blink::WebScreenOrientationLockDefault: |
198 NOTREACHED(); | 198 NOTREACHED(); |
199 return false; | 199 return false; |
200 } | 200 } |
201 | 201 |
202 NOTREACHED(); | 202 NOTREACHED(); |
203 return false; | 203 return false; |
204 } | 204 } |
205 | 205 |
206 } // namespace content | 206 } // namespace content |
OLD | NEW |