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

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: 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
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..8ba14116b2b8f9a1709fa2c5bcfe9acbb21303df 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"
@@ -27,14 +28,16 @@ GlassAppWindowFrameViewWin::GlassAppWindowFrameViewWin(
GlassAppWindowFrameViewWin::~GlassAppWindowFrameViewWin() {
}
-gfx::Insets GlassAppWindowFrameViewWin::GetGlassInsets() const {
+gfx::Insets GlassAppWindowFrameViewWin::GetGlassInsetsInDIP() const {
// If 1 is not subtracted, they are too big. There is possibly some reason
// 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);
}
@@ -43,7 +46,7 @@ gfx::Rect GlassAppWindowFrameViewWin::GetBoundsForClientView() const {
if (widget_->IsFullscreen())
return bounds();
- gfx::Insets insets = GetGlassInsets();
+ gfx::Insets insets = GetGlassInsetsInDIP();
return gfx::Rect(insets.left(),
insets.top(),
std::max(0, width() - insets.left() - insets.right()),
@@ -52,7 +55,7 @@ gfx::Rect GlassAppWindowFrameViewWin::GetBoundsForClientView() const {
gfx::Rect GlassAppWindowFrameViewWin::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
- gfx::Insets insets = GetGlassInsets();
+ gfx::Insets insets = GetGlassInsetsInDIP();
return gfx::Rect(client_bounds.x() - insets.left(),
client_bounds.y() - insets.top(),
client_bounds.width() + insets.left() + insets.right(),
@@ -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,

Powered by Google App Engine
This is Rietveld 408576698