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

Unified Diff: ui/display/screen.h

Issue 2549543002: Clamp dialog bounds to be fully visible on the nearest display (Closed)
Patch Set: Created 4 years 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/display/screen.h
diff --git a/ui/display/screen.h b/ui/display/screen.h
index 3e1b0a0f13de434872dad1f469cd2831aac1a33d..3cfc9d4187b9e32e9da7632a17fe6ca10bb59788 100644
--- a/ui/display/screen.h
+++ b/ui/display/screen.h
@@ -38,6 +38,12 @@ class DISPLAY_EXPORT Screen {
// Tests must be sure to reset any state they install.
static void SetScreenInstance(Screen* instance);
+ // If the given |screen_rect| isn't fully on any display, return a rect that
+ // is fully within the bounds of the work area for the nearest display. If
+ // the rect is already fully on a display, no changes are made.
+ static gfx::Rect MoveScreenRectToNearestDisplay(
+ const gfx::Rect& screen_rect);
+
// Returns the current absolute position of the mouse pointer.
virtual gfx::Point GetCursorScreenPoint() = 0;

Powered by Google App Engine
This is Rietveld 408576698