Commit bfff1719 authored by sungmann.cho's avatar sungmann.cho Committed by Commit bot

[Win] CustomFrameView::IconSize() should return the value in dip unit

CustomFrameView::IconSize() returns the size of the window icon. On Windows,
the value is obtained from GetSystemMetrics(SM_CYSMICON) call, but the problem
is that the value returned is in pixel, not in dip. This leads to a wrong sized
window icon if an user is using a higher scale ratio. This CL replaces
GetSystemMetrics() with display::win::GetSystemMetricsInDIP() to fix this.

BUG=631488
TEST=See the bug page for the reproduce steps

Review-Url: https://codereview.chromium.org/2190593002
Cr-Commit-Position: refs/heads/master@{#408290}
parent e15b5e85
......@@ -31,6 +31,10 @@
#include "ui/views/window/window_resources.h"
#include "ui/views/window/window_shape.h"
#if defined(OS_WIN)
#include "ui/display/win/dpi.h"
#endif
namespace views {
namespace {
......@@ -304,7 +308,7 @@ int CustomFrameView::IconSize() const {
#if defined(OS_WIN)
// This metric scales up if either the titlebar height or the titlebar font
// size are increased.
return GetSystemMetrics(SM_CYSMICON);
return display::win::GetSystemMetricsInDIP(SM_CYSMICON);
#else
return std::max(GetTitleFontList().GetHeight(), kIconMinimumSize);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment