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

Unified Diff: ash/wm/aura/wm_root_window_controller_aura.cc

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 8 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/aura/wm_root_window_controller_aura.h ('k') | ash/wm/aura/wm_window_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/aura/wm_root_window_controller_aura.cc
diff --git a/ash/wm/aura/wm_root_window_controller_aura.cc b/ash/wm/aura/wm_root_window_controller_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a8ed4cfee530883e3a1c463b8e5780128fec63af
--- /dev/null
+++ b/ash/wm/aura/wm_root_window_controller_aura.cc
@@ -0,0 +1,56 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/wm/aura/wm_root_window_controller_aura.h"
+
+#include "ash/root_window_controller.h"
+#include "ui/aura/window.h"
+#include "ui/aura/window_property.h"
+
+DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WmRootWindowControllerAura*);
+
+namespace ash {
+namespace wm {
+
+// TODO(sky): it likely makes more sense to hang this off RootWindowSettings.
+DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::wm::WmRootWindowControllerAura,
+ kWmRootWindowControllerKey,
+ nullptr);
+
+WmRootWindowControllerAura::WmRootWindowControllerAura(
+ RootWindowController* root_window_controller)
+ : root_window_controller_(root_window_controller) {
+ root_window_controller_->GetRootWindow()->SetProperty(
+ kWmRootWindowControllerKey, this);
+}
+
+WmRootWindowControllerAura::~WmRootWindowControllerAura() {}
+
+// static
+const WmRootWindowControllerAura* WmRootWindowControllerAura::Get(
+ const aura::Window* window) {
+ if (!window)
+ return nullptr;
+
+ RootWindowController* root_window_controller =
+ GetRootWindowController(window);
+ if (!root_window_controller)
+ return nullptr;
+
+ WmRootWindowControllerAura* wm_root_window_controller =
+ root_window_controller->GetRootWindow()->GetProperty(
+ kWmRootWindowControllerKey);
+ if (wm_root_window_controller)
+ return wm_root_window_controller;
+
+ // WmRootWindowControllerAura is owned by the RootWindowController's window.
+ return new WmRootWindowControllerAura(root_window_controller);
+}
+
+bool WmRootWindowControllerAura::HasShelf() {
+ return root_window_controller_->shelf() != nullptr;
+}
+
+} // namespace wm
+} // namespace ash
« no previous file with comments | « ash/wm/aura/wm_root_window_controller_aura.h ('k') | ash/wm/aura/wm_window_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698