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

Unified Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.cc

Issue 1889423002: Move Windows DPI Code from ui/gfx to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a TODO Created 4 years, 8 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/frame/glass_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index 04fbcb0afa9ef120d41d37c765e81781507e11cc..b9553425685f33aaa1591cd071630e6476ba50ab 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -26,11 +26,11 @@
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle_win.h"
#include "ui/base/theme_provider.h"
+#include "ui/display/win/dpi.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/icon_util.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/scoped_canvas.h"
-#include "ui/gfx/win/dpi.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/layout_constants.h"
@@ -228,10 +228,11 @@ int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) {
// See if we're in the sysmenu region. We still have to check the tabstrip
// first so that clicks in a tab don't get treated as sysmenu clicks.
int nonclient_border_thickness = NonClientBorderThickness(false);
- if (gfx::Rect(nonclient_border_thickness,
- gfx::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME),
- gfx::win::GetSystemMetricsInDIP(SM_CXSMICON),
- gfx::win::GetSystemMetricsInDIP(SM_CYSMICON)).Contains(point))
+ gfx::Rect sys_menu_region(nonclient_border_thickness,
+ display::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME),
+ display::win::GetSystemMetricsInDIP(SM_CXSMICON),
+ display::win::GetSystemMetricsInDIP(SM_CYSMICON));
+ if (sys_menu_region.Contains(point))
return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU;
if (frame_component != HTNOWHERE)
@@ -300,7 +301,7 @@ bool GlassBrowserFrameView::DoesIntersectRect(const views::View* target,
int GlassBrowserFrameView::FrameBorderThickness() const {
return (frame()->IsMaximized() || frame()->IsFullscreen()) ?
- 0 : gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME);
+ 0 : display::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME);
}
int GlassBrowserFrameView::FrameTopBorderHeight(bool restored) const {
@@ -308,7 +309,7 @@ int GlassBrowserFrameView::FrameTopBorderHeight(bool restored) const {
// frame has a 0 frame border around most edges and a CYSIZEFRAME-thick border
// at the top (see AeroGlassFrame::OnGetMinMaxInfo()).
return (frame()->IsFullscreen() && !restored) ?
- 0 : gfx::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME);
+ 0 : display::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME);
}
int GlassBrowserFrameView::NonClientBorderThickness(bool restored) const {
@@ -520,7 +521,7 @@ void GlassBrowserFrameView::LayoutNewStyleAvatar() {
int button_y = frame()->IsMaximized() ? (FrameTopBorderHeight(false) - 1) : 1;
profile_switcher_.view()->SetBounds(
button_x, button_y, label_size.width(),
- gfx::win::GetSystemMetricsInDIP(SM_CYMENUSIZE) + 1);
+ display::win::GetSystemMetricsInDIP(SM_CYMENUSIZE) + 1);
}
void GlassBrowserFrameView::LayoutIncognitoIcon() {
« no previous file with comments | « chrome/browser/ui/views/elevation_icon_setter.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