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

Unified Diff: ash/system/toast/toast_overlay.cc

Issue 2093283002: mash: Convert all of //ash/system to use WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/system/toast/toast_overlay.cc
diff --git a/ash/system/toast/toast_overlay.cc b/ash/system/toast/toast_overlay.cc
index 038f46f88e257603bf0ac4d54c8c63c620a1726e..21595b64fffebbdc99c08e5bd75505765d6772c2 100644
--- a/ash/system/toast/toast_overlay.cc
+++ b/ash/system/toast/toast_overlay.cc
@@ -4,10 +4,9 @@
#include "ash/system/toast/toast_overlay.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shell_window_ids.h"
#include "ash/screen_util.h"
-#include "ash/shelf/shelf.h"
-#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shell.h"
#include "ash/wm/window_animations.h"
#include "base/strings/string_util.h"
@@ -184,10 +183,8 @@ gfx::Size ToastOverlayView::GetMinimumSize() const {
}
gfx::Size ToastOverlayView::GetMaximumSize() const {
- ShelfLayoutManager* shelf_layout_manager =
- Shelf::ForPrimaryDisplay()->shelf_layout_manager();
- gfx::Rect work_area_bounds = shelf_layout_manager->user_work_area_bounds();
-
+ gfx::Rect work_area_bounds =
+ WmShelf::ForPrimaryDisplay()->GetUserWorkAreaBounds();
msw 2016/06/25 00:18:29 aside: it seems like the shelf shouldn't be the so
James Cook 2016/06/25 01:20:58 Yeah, maybe it should be accessed via RootWindowCo
return gfx::Size(kToastMaximumWidth, work_area_bounds.height() - kOffset * 2);
}
@@ -215,6 +212,8 @@ ToastOverlay::ToastOverlay(Delegate* delegate,
params.remove_standard_frame = true;
params.bounds = CalculateOverlayBounds();
// Show toasts above the app list and below the lock screen.
+ // TODO(jamescook): Either this should be the primary root window, or the
+ // work area bounds computation should be for the target root window.
params.parent = Shell::GetContainer(Shell::GetTargetRootWindow(),
kShellWindowId_SystemModalContainer);
overlay_widget_.reset(new views::Widget);
@@ -262,10 +261,7 @@ void ToastOverlay::Show(bool visible) {
}
gfx::Rect ToastOverlay::CalculateOverlayBounds() {
- ShelfLayoutManager* shelf_layout_manager =
- Shelf::ForPrimaryDisplay()->shelf_layout_manager();
-
- gfx::Rect bounds = shelf_layout_manager->user_work_area_bounds();
+ gfx::Rect bounds = WmShelf::ForPrimaryDisplay()->GetUserWorkAreaBounds();
int target_y = bounds.bottom() - widget_size_.height() - kOffset;
bounds.ClampToCenteredSize(widget_size_);
bounds.set_y(target_y);

Powered by Google App Engine
This is Rietveld 408576698