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

Unified Diff: ash/mus/window_manager.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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/mus/test/wm_test_helper.cc ('k') | ash/touch/touchscreen_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index f02e2c2ed427f6ed0482cf31c69d179fe953e9ee..e2c97177788e6d90670efabff62a24cc66a8054b 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -60,6 +60,7 @@ void WindowManager::Init(
connector_->ConnectToInterface("service:ui", &display_controller_);
screen_ = base::MakeUnique<display::ScreenBase>();
+ display::Screen::SetScreenInstance(screen_.get());
pointer_watcher_event_router_.reset(
new views::PointerWatcherEventRouter(window_tree_client_.get()));
@@ -156,10 +157,10 @@ RootWindowController* WindowManager::CreateRootWindowController(
// notify DisplayObservers. Classic ash does this by making sure
// WindowTreeHostManager is added as a DisplayObserver early on.
std::unique_ptr<display::DisplayListObserverLock> display_lock =
- screen_->display_list()->SuspendObserverUpdates();
- const bool is_first_display = screen_->display_list()->displays().empty();
+ screen_->display_list().SuspendObserverUpdates();
+ const bool is_first_display = screen_->display_list().displays().empty();
// TODO(sky): should be passed whether display is primary.
- screen_->display_list()->AddDisplay(
+ screen_->display_list().AddDisplay(
display, is_first_display ? display::DisplayList::Type::PRIMARY
: display::DisplayList::Type::NOT_PRIMARY);
@@ -175,7 +176,7 @@ RootWindowController* WindowManager::CreateRootWindowController(
for (auto& observer : observers_)
observer.OnRootWindowControllerAdded(root_window_controller);
- for (auto& observer : *screen_->display_list()->observers())
+ for (auto& observer : *screen_->display_list().observers())
observer.OnDisplayAdded(root_window_controller->display());
return root_window_controller;
@@ -236,6 +237,9 @@ void WindowManager::Shutdown() {
window_tree_client_.reset();
window_manager_client_ = nullptr;
+
+ DCHECK_EQ(screen_.get(), display::Screen::GetScreen());
+ display::Screen::SetScreenInstance(nullptr);
}
WindowManager::RootWindowControllers::iterator
« no previous file with comments | « ash/mus/test/wm_test_helper.cc ('k') | ash/touch/touchscreen_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698