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

Unified Diff: ash/shelf/shelf_view.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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/scoped_root_window_for_new_windows.cc ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view.cc
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index cf2b85c8309bc078fe140a6e3cb3641e4e01aa16..fad9003036abc18a9fc9a6759387a97c207b0461 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -429,7 +429,7 @@ void ShelfView::ButtonPressed(views::Button* sender,
DCHECK_LT(-1, last_pressed_index_);
// Place new windows on the same display as the button.
- WmWindow* window = WmWindow::Get(sender->GetWidget()->GetNativeWindow());
+ aura::Window* window = sender->GetWidget()->GetNativeWindow();
scoped_root_window_for_new_windows_.reset(
new ScopedRootWindowForNewWindows(window->GetRootWindow()));
@@ -462,7 +462,8 @@ void ShelfView::ButtonPressed(views::Button* sender,
break;
}
- const int64_t display_id = window->GetDisplayNearestWindow().id();
+ const int64_t display_id =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(window).id();
// Notify the item of its selection; handle the result in AfterItemSelected.
const ShelfItem& item = model_->items()[last_pressed_index_];
@@ -1694,7 +1695,7 @@ void ShelfView::ShowMenu(std::unique_ptr<ui::MenuModel> menu_model,
new views::MenuRunner(menu_model_adapter_->CreateMenu(), run_types));
// Place new windows on the same display as the button that spawned the menu.
- WmWindow* window = WmWindow::Get(source->GetWidget()->GetNativeWindow());
+ aura::Window* window = source->GetWidget()->GetNativeWindow();
scoped_root_window_for_new_windows_.reset(
new ScopedRootWindowForNewWindows(window->GetRootWindow()));
@@ -1705,8 +1706,8 @@ void ShelfView::ShowMenu(std::unique_ptr<ui::MenuModel> menu_model,
// Application lists use a bubble.
// It is possible to invoke the menu while it is sliding into view. To cover
// that case, the screen coordinates are offsetted by the animation delta.
- anchor = source->GetBoundsInScreen() + (window->GetTargetBounds().origin() -
- window->GetBounds().origin());
+ anchor = source->GetBoundsInScreen() +
+ (window->GetTargetBounds().origin() - window->bounds().origin());
// Adjust the anchor location for shelf items with asymmetrical borders.
if (source->border())
« no previous file with comments | « ash/scoped_root_window_for_new_windows.cc ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698