| Index: content/browser/web_contents/web_contents_view_android.cc
|
| diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
|
| index 36ce67bbc77de8acaaf77fe3d59c84b13b20f2e7..33e714ea869ec8b75d5aead4c2d1ee9e479fba31 100644
|
| --- a/content/browser/web_contents/web_contents_view_android.cc
|
| +++ b/content/browser/web_contents/web_contents_view_android.cc
|
| @@ -16,6 +16,9 @@
|
| #include "content/public/browser/render_widget_host.h"
|
| #include "content/public/browser/web_contents_delegate.h"
|
| #include "content/public/common/drop_data.h"
|
| +#include "third_party/WebKit/public/platform/WebScreenInfo.h"
|
| +#include "ui/display/screen.h"
|
| +#include "ui/gfx/android/device_display_info.h"
|
| #include "ui/gfx/android/java_bitmap.h"
|
| #include "ui/gfx/image/image_skia.h"
|
|
|
| @@ -26,6 +29,24 @@ using base::android::ScopedJavaLocalRef;
|
|
|
| namespace content {
|
|
|
| +// static
|
| +void WebContentsView::GetDefaultScreenInfo(
|
| + blink::WebScreenInfo* results) {
|
| + const display::Display& display =
|
| + display::Screen::GetScreen()->GetPrimaryDisplay();
|
| + results->rect = display.bounds();
|
| + // TODO(husky): Remove any system controls from availableRect.
|
| + results->availableRect = display.work_area();
|
| + results->deviceScaleFactor = display.device_scale_factor();
|
| + results->orientationAngle = display.RotationAsDegree();
|
| + results->orientationType =
|
| + RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
|
| + gfx::DeviceDisplayInfo info;
|
| + results->depth = display.color_depth();
|
| + results->depthPerComponent = display.depth_per_component();
|
| + results->isMonochrome = (results->depthPerComponent == 0);
|
| +}
|
| +
|
| WebContentsView* CreateWebContentsView(
|
| WebContentsImpl* web_contents,
|
| WebContentsViewDelegate* delegate,
|
| @@ -84,6 +105,11 @@ gfx::NativeWindow WebContentsViewAndroid::GetTopLevelNativeWindow() const {
|
| return content_view_core_ ? content_view_core_->GetWindowAndroid() : nullptr;
|
| }
|
|
|
| +void WebContentsViewAndroid::GetScreenInfo(blink::WebScreenInfo* result) const {
|
| + // ScreenInfo isn't tied to the widget on Android. Always return the default.
|
| + WebContentsView::GetDefaultScreenInfo(result);
|
| +}
|
| +
|
| void WebContentsViewAndroid::GetContainerBounds(gfx::Rect* out) const {
|
| *out = content_view_core_ ? gfx::Rect(content_view_core_->GetViewSize())
|
| : gfx::Rect();
|
|
|