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

Unified Diff: ash/screen_util.cc

Issue 1684633002: ash/mash: Introduce a ShelfDelegate implementation for mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ash-sysui-window-container
Patch Set: tot-merge Created 4 years, 10 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 | « ash/mus/shell_delegate_mus.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/screen_util.cc
diff --git a/ash/screen_util.cc b/ash/screen_util.cc
index c27d896e52cb2e107fb31b7c1515aba754dc14f5..7e4017e13010b38991bf301f2b8da0749f9d6199 100644
--- a/ash/screen_util.cc
+++ b/ash/screen_util.cc
@@ -65,6 +65,16 @@ gfx::Rect ScreenUtil::GetShelfDisplayBoundsInRoot(aura::Window* window) {
size.Scale(scale, scale);
return gfx::Rect(gfx::ToCeiledSize(size));
} else {
+ if (window->GetRootWindow()->bounds().IsEmpty()) {
+ // TODO(sad): This only happens when running with mustash, since the
+ // root-window here refers to the shelf Widget, which has not been
+ // sized/positioned yet. Use the bounds of the display in this case.
+ // Ideally, we would not run this code at all for mustash.
+ NOTIMPLEMENTED();
+ gfx::Display display =
+ gfx::Screen::GetScreen()->GetDisplayNearestWindow(window);
+ return gfx::Rect(display.size());
+ }
return window->GetRootWindow()->bounds();
}
}
« no previous file with comments | « ash/mus/shell_delegate_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698