OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/web_contents_view_android.h" | 5 #include "content/browser/web_contents/web_contents_view_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/browser/android/content_view_core_impl.h" | 10 #include "content/browser/android/content_view_core_impl.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // TODO(husky): Remove any system controls from availableRect. | 36 // TODO(husky): Remove any system controls from availableRect. |
37 results->available_rect = display.work_area(); | 37 results->available_rect = display.work_area(); |
38 results->device_scale_factor = display.device_scale_factor(); | 38 results->device_scale_factor = display.device_scale_factor(); |
39 results->orientation_angle = display.RotationAsDegree(); | 39 results->orientation_angle = display.RotationAsDegree(); |
40 results->orientation_type = | 40 results->orientation_type = |
41 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 41 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
42 gfx::DeviceDisplayInfo info; | 42 gfx::DeviceDisplayInfo info; |
43 results->depth = display.color_depth(); | 43 results->depth = display.color_depth(); |
44 results->depth_per_component = display.depth_per_component(); | 44 results->depth_per_component = display.depth_per_component(); |
45 results->is_monochrome = display.is_monochrome(); | 45 results->is_monochrome = display.is_monochrome(); |
| 46 results->in_vr = display.in_vr(); |
| 47 LOG(ERROR) << "===amp=== Getting screen info, in vr = " << results->in_vr; |
46 } | 48 } |
47 | 49 |
48 WebContentsView* CreateWebContentsView( | 50 WebContentsView* CreateWebContentsView( |
49 WebContentsImpl* web_contents, | 51 WebContentsImpl* web_contents, |
50 WebContentsViewDelegate* delegate, | 52 WebContentsViewDelegate* delegate, |
51 RenderViewHostDelegateView** render_view_host_delegate_view) { | 53 RenderViewHostDelegateView** render_view_host_delegate_view) { |
52 WebContentsViewAndroid* rv = new WebContentsViewAndroid( | 54 WebContentsViewAndroid* rv = new WebContentsViewAndroid( |
53 web_contents, delegate); | 55 web_contents, delegate); |
54 *render_view_host_delegate_view = rv; | 56 *render_view_host_delegate_view = rv; |
55 return rv; | 57 return rv; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // This is called when we the renderer asks us to take focus back (i.e., it has | 322 // This is called when we the renderer asks us to take focus back (i.e., it has |
321 // iterated past the last focusable element on the page). | 323 // iterated past the last focusable element on the page). |
322 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 324 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
323 if (web_contents_->GetDelegate() && | 325 if (web_contents_->GetDelegate() && |
324 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 326 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
325 return; | 327 return; |
326 web_contents_->GetRenderWidgetHostView()->Focus(); | 328 web_contents_->GetRenderWidgetHostView()->Focus(); |
327 } | 329 } |
328 | 330 |
329 } // namespace content | 331 } // namespace content |
OLD | NEW |