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

Unified Diff: ui/views/corewm/tooltip_win.cc

Issue 1426933002: Refactor Windows DPI Point, Rect, and Size for Multiple Monitor DPI Awareness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Other Unit Tests - Moved Inner Classes Outside Created 4 years, 11 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: ui/views/corewm/tooltip_win.cc
diff --git a/ui/views/corewm/tooltip_win.cc b/ui/views/corewm/tooltip_win.cc
index 46635d2ba5d137b818eabf946bd582bb6a8b82e4..890198d4501d730573d6f70721d09557a76bc213 100644
--- a/ui/views/corewm/tooltip_win.cc
+++ b/ui/views/corewm/tooltip_win.cc
@@ -12,7 +12,7 @@
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/screen.h"
-#include "ui/gfx/win/dpi.h"
+#include "ui/gfx/screen_win.h"
#include "ui/views/corewm/cursor_height_provider_win.h"
namespace views {
@@ -77,8 +77,7 @@ bool TooltipWin::EnsureTooltipWindow() {
}
void TooltipWin::PositionTooltip() {
- // This code only runs for non-metro, so GetNativeScreen() is fine.
- gfx::Point screen_point = gfx::win::DIPToScreenPoint(location_);
+ gfx::Point screen_point = gfx::ScreenWin::DIPToScreenPoint(location_);
const int cursoroffset = GetCurrentCursorVisibleHeight();
screen_point.Offset(0, cursoroffset);
@@ -86,11 +85,13 @@ void TooltipWin::PositionTooltip() {
reinterpret_cast<LPARAM>(&toolinfo_));
const gfx::Size size(LOWORD(tooltip_size), HIWORD(tooltip_size));
+ // This code only runs for non-metro, so GetNativeScreen() is fine.
const gfx::Display display(
- gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(screen_point));
+ gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(location_));
gfx::Rect tooltip_bounds(screen_point, size);
- tooltip_bounds.AdjustToFit(gfx::win::DIPToScreenRect(display.work_area()));
+ tooltip_bounds.AdjustToFit(
+ gfx::ScreenWin::DIPToScreenRect(parent_hwnd_, display.work_area()));
SetWindowPos(tooltip_hwnd_, NULL, tooltip_bounds.x(), tooltip_bounds.y(), 0,
0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
@@ -98,7 +99,7 @@ void TooltipWin::PositionTooltip() {
int TooltipWin::GetMaxWidth(const gfx::Point& location,
aura::Window* context) const {
// This code only runs for non-metro, so GetNativeScreen() is fine.
- const gfx::Point screen_point = gfx::win::DIPToScreenPoint(location);
+ const gfx::Point screen_point = gfx::ScreenWin::DIPToScreenPoint(location);
gfx::Display display(
gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(screen_point));
const gfx::Rect monitor_bounds = display.bounds();

Powered by Google App Engine
This is Rietveld 408576698