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

Unified Diff: chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc

Issue 394013002: Convert insets to pixels for app windows via the Scale method in the Insets class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc
diff --git a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc
index be9a207739527d43786b82e5496f2942be979e01..d0e1130feacbc815a0b117b3647fac8d5371265d 100644
--- a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc
+++ b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc
@@ -75,17 +75,11 @@ void AppWindowDesktopWindowTreeHostWin::UpdateDWMFrame() {
gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets();
// The DWM API's expect values in pixels. We need to convert from DIP to
// pixels here.
- gfx::Rect insets_rect_in_pixels(insets.left(),
- insets.top(),
- insets.right() - insets.left(),
- insets.bottom() - insets.top());
- insets_rect_in_pixels = gfx::win::DIPToScreenRect(insets_rect_in_pixels);
- margins.cxLeftWidth = insets_rect_in_pixels.x();
- margins.cxRightWidth =
- insets_rect_in_pixels.x() + insets_rect_in_pixels.width();
- margins.cyBottomHeight =
- insets_rect_in_pixels.y() + insets_rect_in_pixels.height();
- margins.cyTopHeight = insets_rect_in_pixels.y();
+ insets = insets.Scale(gfx::win::GetDeviceScaleFactor());
+ margins.cxLeftWidth = insets.left();
+ margins.cxRightWidth = insets.right();
+ margins.cyBottomHeight = insets.bottom();
+ margins.cyTopHeight = insets.top();
}
DwmExtendFrameIntoClientArea(GetHWND(), &margins);
« 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