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

Unified Diff: ui/views/controls/native/native_view_host.cc

Issue 14348033: NOT FOR SUBMIT - Windows Views HiDPI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revert spurious changes, plus some corrections. Created 7 years, 7 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 | « ui/surface/accelerated_surface_win.cc ('k') | ui/views/widget/aero_tooltip_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/native/native_view_host.cc
diff --git a/ui/views/controls/native/native_view_host.cc b/ui/views/controls/native/native_view_host.cc
index a5ae61d33ae7a67f707c0b9a7d5516627a8df030..4ddf4fd57f6d52332702b0cae59e59c6d75f4791 100644
--- a/ui/views/controls/native/native_view_host.cc
+++ b/ui/views/controls/native/native_view_host.cc
@@ -9,6 +9,10 @@
#include "ui/views/controls/native/native_view_host_wrapper.h"
#include "ui/views/widget/widget.h"
+#if defined (OS_WIN)
+#include "ui/base/win/dpi.h"
+#endif
+
namespace views {
// static
@@ -100,9 +104,16 @@ void NativeViewHost::Layout() {
// view. Also, they should be positioned respecting the border insets
// of the native view.
gfx::Rect local_bounds = ConvertRectToWidget(GetContentsBounds());
+#if defined (OS_WIN)
+ gfx::Rect mapped_bounds = ui::win::DIPToScreenRect(local_bounds);
+ native_wrapper_->ShowWidget(mapped_bounds.x(), mapped_bounds.y(),
+ mapped_bounds.width(),
+ mapped_bounds.height());
+#else
native_wrapper_->ShowWidget(local_bounds.x(), local_bounds.y(),
local_bounds.width(),
local_bounds.height());
+#endif
} else {
native_wrapper_->HideWidget();
}
« no previous file with comments | « ui/surface/accelerated_surface_win.cc ('k') | ui/views/widget/aero_tooltip_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698