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

Unified Diff: ash/common/wm/workspace_controller.cc

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 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/common/wm/workspace_controller.h ('k') | ash/common/wm_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/workspace_controller.cc
diff --git a/ash/common/wm/workspace_controller.cc b/ash/common/wm/workspace_controller.cc
index d93bae8a4ebeab59be9f0248503f5bdc30a3358c..09f742be505661931b4e4bd67343bed4ea5704c3 100644
--- a/ash/common/wm/workspace_controller.cc
+++ b/ash/common/wm/workspace_controller.cc
@@ -38,7 +38,7 @@ WorkspaceController::WorkspaceController(WmWindow* viewport)
: viewport_(viewport),
event_handler_(WmShell::Get()->CreateWorkspaceEventHandler(viewport)),
layout_manager_(new WorkspaceLayoutManager(viewport)) {
- viewport_->AddObserver(this);
+ viewport_->aura_window()->AddObserver(this);
viewport_->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE);
viewport_->SetLayoutManager(base::WrapUnique(layout_manager_));
}
@@ -47,7 +47,7 @@ WorkspaceController::~WorkspaceController() {
if (!viewport_)
return;
- viewport_->RemoveObserver(this);
+ viewport_->aura_window()->RemoveObserver(this);
viewport_->SetLayoutManager(nullptr);
}
@@ -122,9 +122,9 @@ void WorkspaceController::SetMaximizeBackdropDelegate(
layout_manager_->SetMaximizeBackdropDelegate(std::move(delegate));
}
-void WorkspaceController::OnWindowDestroying(WmWindow* window) {
- DCHECK_EQ(window, viewport_);
- viewport_->RemoveObserver(this);
+void WorkspaceController::OnWindowDestroying(aura::Window* window) {
+ DCHECK_EQ(WmWindow::Get(window), viewport_);
+ viewport_->aura_window()->RemoveObserver(this);
viewport_ = nullptr;
// Destroy |event_handler_| too as it depends upon |window|.
event_handler_.reset();
« no previous file with comments | « ash/common/wm/workspace_controller.h ('k') | ash/common/wm_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698