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

Side by Side Diff: chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc

Issue 674763002: remove ui::gfx::GetDeviceScaleFactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dpi-cleanup-3
Patch Set: rebase-4 Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.h " 5 #include "chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.h "
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h" 9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h"
10 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h" 10 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return; 68 return;
69 69
70 MARGINS margins = {0}; 70 MARGINS margins = {0};
71 71
72 // If the opaque frame is visible, we use the default (zero) margins. 72 // If the opaque frame is visible, we use the default (zero) margins.
73 // Otherwise, we need to figure out how to extend the glass in. 73 // Otherwise, we need to figure out how to extend the glass in.
74 if (app_window_->glass_frame_view()) { 74 if (app_window_->glass_frame_view()) {
75 gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets(); 75 gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets();
76 // The DWM API's expect values in pixels. We need to convert from DIP to 76 // The DWM API's expect values in pixels. We need to convert from DIP to
77 // pixels here. 77 // pixels here.
78 insets = insets.Scale(gfx::win::GetDeviceScaleFactor()); 78 insets = insets.Scale(gfx::GetDPIScale());
79 margins.cxLeftWidth = insets.left(); 79 margins.cxLeftWidth = insets.left();
80 margins.cxRightWidth = insets.right(); 80 margins.cxRightWidth = insets.right();
81 margins.cyBottomHeight = insets.bottom(); 81 margins.cyBottomHeight = insets.bottom();
82 margins.cyTopHeight = insets.top(); 82 margins.cyTopHeight = insets.top();
83 } 83 }
84 84
85 DwmExtendFrameIntoClientArea(GetHWND(), &margins); 85 DwmExtendFrameIntoClientArea(GetHWND(), &margins);
86 } 86 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader_win.cc ('k') | chrome/browser/ui/views/frame/minimize_button_metrics_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698