Introduce RootWindowProperty for RootWindow's properties
BUG=272460
Review URL: https://chromiumcodereview.appspot.com/23496024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220667 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ash/root_window_settings.cc b/ash/root_window_settings.cc
new file mode 100644
index 0000000..a5e3968
--- /dev/null
+++ b/ash/root_window_settings.cc
@@ -0,0 +1,40 @@
+// Copyright 2013 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/root_window_settings.h"
+
+#include "ui/aura/root_window.h"
+#include "ui/aura/window_property.h"
+#include "ui/gfx/display.h"
+
+DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::RootWindowSettings*);
+
+namespace ash {
+namespace internal {
+
+DEFINE_OWNED_WINDOW_PROPERTY_KEY(RootWindowSettings,
+ kRootWindowSettingsKey, NULL);
+
+RootWindowSettings::RootWindowSettings()
+ : solo_window_header(false),
+ display_id(gfx::Display::kInvalidDisplayID),
+ controller(NULL) {
+}
+
+RootWindowSettings* InitRootWindowSettings(aura::RootWindow* root) {
+ RootWindowSettings* property = new RootWindowSettings();
+ root->SetProperty(kRootWindowSettingsKey, property);
+ return property;
+}
+
+RootWindowSettings* GetRootWindowSettings(aura::RootWindow* root) {
+ return root->GetProperty(kRootWindowSettingsKey);
+}
+
+const RootWindowSettings* GetRootWindowSettings(const aura::RootWindow* root) {
+ return root->GetProperty(kRootWindowSettingsKey);
+}
+
+} // namespace internal
+} // namespace ash