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

Unified Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2215223004: mash: Migrate ShelfLayoutManager ScreenUtil usage to ash common types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore screen bounds conversion for app list. Created 4 years, 4 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 | « no previous file | ash/aura/wm_shell_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/app_list_presenter_delegate.cc
diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc
index 3fca25319dfdf39b6969d0a2b87d5d376bdd976e..cefa08642861c0af1aef0db8342b882a684668c1 100644
--- a/ash/app_list/app_list_presenter_delegate.cc
+++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -9,7 +9,10 @@
#include "ash/common/shelf/shelf_types.h"
#include "ash/common/shell_window_ids.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
+#include "ash/common/wm/wm_screen_util.h"
+#include "ash/common/wm_lookup.h"
#include "ash/common/wm_shell.h"
+#include "ash/common/wm_window.h"
#include "ash/display/window_tree_host_manager.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
@@ -78,11 +81,10 @@ gfx::Vector2d GetAnchorPositionOffsetToShelf(const gfx::Rect& button_bounds,
// This calculation excludes the virtual keyboard area. If the height of the
// display area is less than |minimum_height|, its bottom will be extended to
// that height (so that the app list never starts above the top of the screen).
-gfx::Point GetCenterOfDisplayForView(const views::View* view,
- int minimum_height) {
- aura::Window* window = view->GetWidget()->GetNativeView();
- gfx::Rect bounds = ScreenUtil::GetShelfDisplayBoundsInRoot(window);
- bounds = ScreenUtil::ConvertRectToScreen(window->GetRootWindow(), bounds);
+gfx::Point GetCenterOfDisplayForView(views::View* view, int minimum_height) {
+ WmWindow* window = WmLookup::Get()->GetWindowForWidget(view->GetWidget());
+ gfx::Rect bounds = wm::GetDisplayBoundsWithShelf(window);
+ bounds = window->GetRootWindow()->ConvertRectToScreen(bounds);
// If the virtual keyboard is active, subtract it from the display bounds, so
// that the app list is centered in the non-keyboard area of the display.
« no previous file with comments | « no previous file | ash/aura/wm_shell_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698