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

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

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase 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
« no previous file with comments | « ui/views/corewm/tooltip_win.h ('k') | ui/views/drag_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b892d3871a2080acecc5cdca85e7b619b2b30d75 100644
--- a/ui/views/corewm/tooltip_win.cc
+++ b/ui/views/corewm/tooltip_win.cc
@@ -77,7 +77,6 @@ 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_);
const int cursoroffset = GetCurrentCursorVisibleHeight();
screen_point.Offset(0, cursoroffset);
@@ -87,7 +86,7 @@ void TooltipWin::PositionTooltip() {
const gfx::Size size(LOWORD(tooltip_size), HIWORD(tooltip_size));
const gfx::Display display(
- gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(screen_point));
+ gfx::Screen::GetScreen()->GetDisplayNearestPoint(screen_point));
gfx::Rect tooltip_bounds(screen_point, size);
tooltip_bounds.AdjustToFit(gfx::win::DIPToScreenRect(display.work_area()));
@@ -95,12 +94,10 @@ void TooltipWin::PositionTooltip() {
0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
-int TooltipWin::GetMaxWidth(const gfx::Point& location,
- aura::Window* context) const {
- // This code only runs for non-metro, so GetNativeScreen() is fine.
+int TooltipWin::GetMaxWidth(const gfx::Point& location) const {
const gfx::Point screen_point = gfx::win::DIPToScreenPoint(location);
gfx::Display display(
- gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(screen_point));
+ gfx::Screen::GetScreen()->GetDisplayNearestPoint(screen_point));
const gfx::Rect monitor_bounds = display.bounds();
return (monitor_bounds.width() + 1) / 2;
}
@@ -126,7 +123,7 @@ void TooltipWin::SetText(aura::Window* window,
SendMessage(tooltip_hwnd_, TTM_SETTOOLINFO, 0,
reinterpret_cast<LPARAM>(&toolinfo_));
- int max_width = GetMaxWidth(location_, window);
+ int max_width = GetMaxWidth(location_);
SendMessage(tooltip_hwnd_, TTM_SETMAXTIPWIDTH, 0, max_width);
}
« no previous file with comments | « ui/views/corewm/tooltip_win.h ('k') | ui/views/drag_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698