1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/root_window_settings.h"
7 #include "ui/aura/window.h"
8 #include "ui/aura/window_event_dispatcher.h"
9 #include "ui/base/class_property.h"
10 #include "ui/display/types/display_constants.h"
12 DEFINE_UI_CLASS_PROPERTY_TYPE(ash::RootWindowSettings*)
16 DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(RootWindowSettings,
17 kRootWindowSettingsKey,
20 RootWindowSettings::RootWindowSettings()
21 : display_id(display::kInvalidDisplayId), controller(nullptr) {}
23 RootWindowSettings* InitRootWindowSettings(aura::Window* root) {
24 return root->SetProperty(kRootWindowSettingsKey,
25 std::make_unique<RootWindowSettings>());
28 RootWindowSettings* GetRootWindowSettings(aura::Window* root) {
29 return root->GetProperty(kRootWindowSettingsKey);
32 const RootWindowSettings* GetRootWindowSettings(const aura::Window* root) {
33 return root->GetProperty(kRootWindowSettingsKey);