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

Unified Diff: ash/wm/window_state_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/window_state_aura.h ('k') | ash/wm/window_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_state_aura.cc
diff --git a/ash/wm/window_state_aura.cc b/ash/wm/window_state_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ce3e03f41285b060b0779f5a22cde26a1efde630
--- /dev/null
+++ b/ash/wm/window_state_aura.cc
@@ -0,0 +1,37 @@
+// 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/window_state_aura.h"
+
+#include "ash/wm/aura/wm_window_aura.h"
+#include "ash/wm/window_properties.h"
+#include "ash/wm/window_state.h"
+#include "ash/wm/window_util.h"
+#include "ui/aura/window.h"
+
+namespace ash {
+namespace wm {
+
+WindowState* GetActiveWindowState() {
+ aura::Window* active = GetActiveWindow();
+ return active ? GetWindowState(active) : nullptr;
+}
+
+WindowState* GetWindowState(aura::Window* window) {
+ if (!window)
+ return nullptr;
+ WindowState* settings = window->GetProperty(kWindowStateKey);
+ if (!settings) {
+ settings = new WindowState(WmWindowAura::Get(window));
+ window->SetProperty(kWindowStateKey, settings);
+ }
+ return settings;
+}
+
+const WindowState* GetWindowState(const aura::Window* window) {
+ return GetWindowState(const_cast<aura::Window*>(window));
+}
+
+} // namespace wm
+} // namespace ash
« no previous file with comments | « ash/wm/window_state_aura.h ('k') | ash/wm/window_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698