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

Unified Diff: ash/shelf/shelf_controller.cc

Issue 2907853002: [mus+ash] Removes WmWindow from ash/shelf and ash/shell (Closed)
Patch Set: [mus+ash] Removes WmWindow from ash/shelf and ash/shell (removed some more wm_window.h) 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/shelf/shelf.cc ('k') | ash/shelf/shelf_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_controller.cc
diff --git a/ash/shelf/shelf_controller.cc b/ash/shelf/shelf_controller.cc
index f361975082dfa728a26c41495a20441aa04ea979..876c5d0df2edaf39b765410901a89682415bb8aa 100644
--- a/ash/shelf/shelf_controller.cc
+++ b/ash/shelf/shelf_controller.cc
@@ -43,7 +43,9 @@ void ShelfController::BindRequest(mojom::ShelfControllerRequest request) {
void ShelfController::NotifyShelfInitialized(Shelf* shelf) {
// Notify observers, Chrome will set alignment and auto-hide from prefs.
- int64_t display_id = shelf->GetWindow()->GetDisplayNearestWindow().id();
+ display::Display display =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(shelf->GetWindow());
+ int64_t display_id = display.id();
observers_.ForAllPtrs([display_id](mojom::ShelfObserver* observer) {
observer->OnShelfInitialized(display_id);
});
@@ -51,7 +53,9 @@ void ShelfController::NotifyShelfInitialized(Shelf* shelf) {
void ShelfController::NotifyShelfAlignmentChanged(Shelf* shelf) {
ShelfAlignment alignment = shelf->alignment();
- int64_t display_id = shelf->GetWindow()->GetDisplayNearestWindow().id();
+ display::Display display =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(shelf->GetWindow());
+ int64_t display_id = display.id();
observers_.ForAllPtrs(
[alignment, display_id](mojom::ShelfObserver* observer) {
observer->OnAlignmentChanged(alignment, display_id);
@@ -60,7 +64,9 @@ void ShelfController::NotifyShelfAlignmentChanged(Shelf* shelf) {
void ShelfController::NotifyShelfAutoHideBehaviorChanged(Shelf* shelf) {
ShelfAutoHideBehavior behavior = shelf->auto_hide_behavior();
- int64_t display_id = shelf->GetWindow()->GetDisplayNearestWindow().id();
+ display::Display display =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(shelf->GetWindow());
+ int64_t display_id = display.id();
observers_.ForAllPtrs([behavior, display_id](mojom::ShelfObserver* observer) {
observer->OnAutoHideBehaviorChanged(behavior, display_id);
});
« no previous file with comments | « ash/shelf/shelf.cc ('k') | ash/shelf/shelf_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698