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

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

Issue 382013004: Fix the black patch which would appear at the top of app windows in Chrome desktop windows with HiD… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review comments 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 | « chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc ('k') | 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/glass_app_window_frame_view_win.cc
diff --git a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
index 5f31c610299a69d0ccf3f48fc570f32f0dfa397d..ee2fe5a95cdaa283d55862aa499e25ab6e7e30c6 100644
--- a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
+++ b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
@@ -6,6 +6,7 @@
#include "apps/ui/native_app_window.h"
#include "ui/base/hit_test.h"
+#include "ui/gfx/win/dpi.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -32,9 +33,11 @@ gfx::Insets GlassAppWindowFrameViewWin::GetGlassInsets() const {
// for that.
// Also make sure the insets don't go below 1, as bad things happen when they
// do.
- int caption_height = std::max(
- 0, GetSystemMetrics(SM_CYSMICON) + GetSystemMetrics(SM_CYSIZEFRAME) - 1);
- int frame_size = std::max(1, GetSystemMetrics(SM_CXSIZEFRAME) - 1);
+ int caption_height = std::max(0,
+ gfx::win::GetSystemMetricsInDIP(SM_CYSMICON) +
+ gfx::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME) - 1);
+ int frame_size =
+ std::max(1, gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME) - 1);
return gfx::Insets(
frame_size + caption_height, frame_size, frame_size, frame_size);
}
@@ -73,7 +76,7 @@ int GlassAppWindowFrameViewWin::NonClientHitTest(const gfx::Point& point) {
: false;
// Don't allow overlapping resize handles when the window is maximized or
// fullscreen, as it can't be resized in those states.
- int resize_border = GetSystemMetrics(SM_CXSIZEFRAME);
+ int resize_border = gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME);
int frame_component =
GetHTComponentForFrame(point,
resize_border,
« no previous file with comments | « chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698