Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 12290005: Android ScreenInfo size in DIP instead of device pixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 465058141cea64aec560587db61f07169090425a..3628f2549fa8c8d3430edb31388dc75ab306cc03 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -28,6 +28,8 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
#include "ui/gfx/android/device_display_info.h"
#include "ui/gfx/android/java_bitmap.h"
+#include "ui/gfx/display.h"
+#include "ui/gfx/screen.h"
#include "ui/gfx/size_conversions.h"
#include "webkit/compositor_bindings/web_compositor_support_impl.h"
@@ -627,16 +629,17 @@ void RenderWidgetHostViewAndroid::HasTouchEventHandlers(
// static
void RenderWidgetHostViewPort::GetDefaultScreenInfo(
WebKit::WebScreenInfo* results) {
+ const gfx::Display& display =
+ gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
+ results->rect = display.bounds();
+ // TODO(husky): Remove any system controls from availableRect.
+ results->availableRect = display.work_area();
+ results->deviceScaleFactor = display.device_scale_factor();
+
gfx::DeviceDisplayInfo info;
- const int width = info.GetDisplayWidth();
- const int height = info.GetDisplayHeight();
- results->deviceScaleFactor = info.GetDIPScale();
- results->depth = info.GetBitsPerPixel();
+ results->depth = info.GetBitsPerPixel();;
aelias_OOO_until_Jul13 2013/02/15 21:04:08 Typo: extra semicolon
results->depthPerComponent = info.GetBitsPerComponent();
results->isMonochrome = (results->depthPerComponent == 0);
- results->rect = WebKit::WebRect(0, 0, width, height);
- // TODO(husky): Remove any system controls from availableRect.
- results->availableRect = WebKit::WebRect(0, 0, width, height);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698