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

Unified Diff: ash/root_window_controller.cc

Issue 2633293005: Converts mash to use Shell (Closed)
Patch Set: feedback Created 3 years, 11 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/root_window_controller.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index e9d7a93977e2f9158f27fdf47b230cb5ee4a3032..ed933609b43bce42fd7c190b599a4a492af24cf6 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -4,6 +4,7 @@
#include "ash/root_window_controller.h"
+#include <algorithm>
#include <queue>
#include <vector>
@@ -271,6 +272,10 @@ bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) {
} // namespace
+// static
+std::vector<RootWindowController*>*
+ RootWindowController::root_window_controllers_ = nullptr;
+
RootWindowController::~RootWindowController() {
Shutdown();
ash_host_.reset();
@@ -280,6 +285,9 @@ RootWindowController::~RootWindowController() {
capture_client_.reset();
if (animating_wallpaper_widget_controller_.get())
animating_wallpaper_widget_controller_->StopAnimating();
+ root_window_controllers_->erase(std::find(root_window_controllers_->begin(),
+ root_window_controllers_->end(),
+ this));
}
void RootWindowController::CreateForPrimaryDisplay(AshWindowTreeHost* host) {
@@ -748,6 +756,11 @@ RootWindowController::RootWindowController(
: window_tree_host),
wm_shelf_(base::MakeUnique<WmShelf>()) {
DCHECK((ash_host && !window_tree_host) || (!ash_host && window_tree_host));
+
+ if (!root_window_controllers_)
+ root_window_controllers_ = new std::vector<RootWindowController*>;
+ root_window_controllers_->push_back(this);
+
aura::Window* root_window = GetRootWindow();
GetRootWindowSettings(root_window)->controller = this;
@@ -760,11 +773,8 @@ RootWindowController::RootWindowController(
void RootWindowController::Init(RootWindowType root_window_type) {
aura::Window* root_window = GetRootWindow();
WmShell* wm_shell = WmShell::Get();
- Shell* shell = nullptr;
- if (!wm_shell->IsRunningInMash()) {
- shell = Shell::GetInstance();
- shell->InitRootWindow(root_window);
- }
+ Shell* shell = Shell::GetInstance();
+ shell->InitRootWindow(root_window);
CreateContainers();
@@ -793,8 +803,7 @@ void RootWindowController::Init(RootWindowType root_window_type) {
CreateShelf();
// Notify shell observers about new root window.
- if (!wm_shell->IsRunningInMash())
- shell->OnRootWindowAdded(WmWindow::Get(root_window));
+ shell->OnRootWindowAdded(WmWindow::Get(root_window));
}
// TODO: AshTouchExplorationManager doesn't work with mus.
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698