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

Unified Diff: ash/wm/screen_pinning_controller.cc

Issue 2777103005: Using WmDisplayObserver in ScreenPinningController. (Closed)
Patch Set: Created 3 years, 9 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/wm/screen_pinning_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/screen_pinning_controller.cc
diff --git a/ash/wm/screen_pinning_controller.cc b/ash/wm/screen_pinning_controller.cc
index 4a708dbf21d3cdd59888858d18a454c806a0ac4a..04a1b6d96bff5fdc91223bd9c90e926a2b07114e 100644
--- a/ash/wm/screen_pinning_controller.cc
+++ b/ash/wm/screen_pinning_controller.cc
@@ -11,8 +11,8 @@
#include "ash/common/wm/container_finder.h"
#include "ash/common/wm/window_dimmer.h"
#include "ash/common/wm/window_state.h"
+#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
-#include "ash/display/window_tree_host_manager.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/shell.h"
#include "base/auto_reset.h"
@@ -147,10 +147,8 @@ class ScreenPinningController::SystemModalContainerWindowObserver
DISALLOW_COPY_AND_ASSIGN(SystemModalContainerWindowObserver);
};
-ScreenPinningController::ScreenPinningController(
- WindowTreeHostManager* window_tree_host_manager)
+ScreenPinningController::ScreenPinningController()
: window_dimmers_(base::MakeUnique<WindowUserData<WindowDimmer>>()),
- window_tree_host_manager_(window_tree_host_manager),
pinned_container_window_observer_(
base::MakeUnique<PinnedContainerWindowObserver>(this)),
pinned_container_child_window_observer_(
@@ -159,11 +157,11 @@ ScreenPinningController::ScreenPinningController(
base::MakeUnique<SystemModalContainerWindowObserver>(this)),
system_modal_container_child_window_observer_(
base::MakeUnique<SystemModalContainerChildWindowObserver>(this)) {
- window_tree_host_manager_->AddObserver(this);
+ WmShell::Get()->AddDisplayObserver(this);
}
ScreenPinningController::~ScreenPinningController() {
- window_tree_host_manager_->RemoveObserver(this);
+ WmShell::Get()->RemoveDisplayObserver(this);
}
bool ScreenPinningController::IsPinned() const {
« no previous file with comments | « ash/wm/screen_pinning_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698