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

Unified Diff: ash/wm/window_state.cc

Issue 2889413002: chromeos: nukes window_state_aura (Closed)
Patch Set: merge, remove include from windows and shuffle functions for declaration Created 3 years, 7 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.h ('k') | ash/wm/window_state_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_state.cc
diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc
index 4050fd16c27945765d581a1a719ca1f21a26d618..a5488c1472f92689f4f040bdd198d76146b0ae3b 100644
--- a/ash/wm/window_state.cc
+++ b/ash/wm/window_state.cc
@@ -11,8 +11,10 @@
#include "ash/screen_util.h"
#include "ash/wm/default_state.h"
#include "ash/wm/window_positioning_utils.h"
+#include "ash/wm/window_properties.h"
#include "ash/wm/window_state_delegate.h"
#include "ash/wm/window_state_observer.h"
+#include "ash/wm/window_util.h"
#include "ash/wm/wm_event.h"
#include "ash/wm_window.h"
#include "base/auto_reset.h"
@@ -429,5 +431,25 @@ void WindowState::SetBoundsDirectCrossFade(const gfx::Rect& new_bounds) {
window_->SetBoundsDirectCrossFade(new_bounds);
}
+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(WmWindow::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.h ('k') | ash/wm/window_state_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698