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

Unified Diff: ash/tooltips/tooltip_controller.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tidy Created 8 years, 2 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: ash/tooltips/tooltip_controller.cc
diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc
index fd70c0df193d8fe0687bb859c5727d0ff9c37752..0cd5e423a5666050e599b6edaaa23934d7a95747 100644
--- a/ash/tooltips/tooltip_controller.cc
+++ b/ash/tooltips/tooltip_controller.cc
@@ -69,7 +69,9 @@ int GetMaxWidth(int x, int y) {
// TODO(varunjain): implementation duplicated in tooltip_manager_aura. Figure
// out a way to merge.
gfx::Rect display_bounds =
- gfx::Screen::GetDisplayNearestPoint(gfx::Point(x, y)).bounds();
+ gfx::Screen::GetDisplayNearestPoint(
+ ash::Shell::GetPrimaryRootWindow(),
+ gfx::Point(x, y)).bounds();
return (display_bounds.width() + 1) / 2;
}
@@ -165,7 +167,9 @@ class TooltipController::Tooltip : public views::WidgetObserver {
tooltip_rect.Offset(kCursorOffsetX, kCursorOffsetY);
gfx::Rect display_bounds =
- gfx::Screen::GetDisplayNearestPoint(tooltip_rect.origin()).bounds();
+ gfx::Screen::GetDisplayNearestPoint(
+ ash::Shell::GetPrimaryRootWindow(),
+ tooltip_rect.origin()).bounds();
// If tooltip is out of bounds on the x axis, we simply shift it
// horizontally by the offset.

Powered by Google App Engine
This is Rietveld 408576698