| Index: ui/gfx/screen_android.cc
|
| diff --git a/ui/gfx/screen_android.cc b/ui/gfx/screen_android.cc
|
| index a80582e077d22e1ff373c70f50f66cec6a534778..9ac81e3f89fffe3efe2976a185b4320b337d4262 100644
|
| --- a/ui/gfx/screen_android.cc
|
| +++ b/ui/gfx/screen_android.cc
|
| @@ -5,7 +5,9 @@
|
| #include "ui/gfx/screen.h"
|
|
|
| #include "base/logging.h"
|
| +#include "ui/gfx/android/device_info.h"
|
| #include "ui/gfx/display.h"
|
| +#include "ui/gfx/size_conversions.h"
|
|
|
| namespace gfx {
|
|
|
| @@ -14,7 +16,7 @@ class ScreenAndroid : public Screen {
|
| ScreenAndroid() {}
|
|
|
| bool IsDIPEnabled() OVERRIDE {
|
| - return false;
|
| + return true;
|
| }
|
|
|
| gfx::Point GetCursorScreenPoint() OVERRIDE {
|
| @@ -27,8 +29,16 @@ class ScreenAndroid : public Screen {
|
| }
|
|
|
| gfx::Display GetPrimaryDisplay() const OVERRIDE {
|
| - NOTIMPLEMENTED() << "crbug.com/117839 tracks implementation";
|
| - return gfx::Display(0, gfx::Rect(0, 0, 1, 1));
|
| + gfx::DeviceInfo device_info;
|
| + const float device_scale_factor = device_info.GetDPIScale();
|
| + const gfx::Rect bounds_in_pixels =
|
| + gfx::Rect(device_info.GetWidth(), device_info.GetHeight());
|
| + const gfx::Rect bounds_in_dip =
|
| + gfx::Rect(gfx::ToRoundedSize(gfx::ScaleSize(
|
| + bounds_in_pixels.size(), 1.0f / device_scale_factor)));
|
| + gfx::Display display(0, bounds_in_dip);
|
| + display.set_device_scale_factor(device_info.GetDPIScale());
|
| + return display;
|
| }
|
|
|
| gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const OVERRIDE {
|
|
|