Fix FullScreen crash in Webapp
[platform/framework/web/chromium-efl.git] / ash / root_window_settings.cc
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.
4
5 #include "ash/root_window_settings.h"
6
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"
11
12 DEFINE_UI_CLASS_PROPERTY_TYPE(ash::RootWindowSettings*)
13
14 namespace ash {
15
16 DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(RootWindowSettings,
17                                    kRootWindowSettingsKey,
18                                    nullptr)
19
20 RootWindowSettings::RootWindowSettings()
21     : display_id(display::kInvalidDisplayId), controller(nullptr) {}
22
23 RootWindowSettings* InitRootWindowSettings(aura::Window* root) {
24   return root->SetProperty(kRootWindowSettingsKey,
25                            std::make_unique<RootWindowSettings>());
26 }
27
28 RootWindowSettings* GetRootWindowSettings(aura::Window* root) {
29   return root->GetProperty(kRootWindowSettingsKey);
30 }
31
32 const RootWindowSettings* GetRootWindowSettings(const aura::Window* root) {
33   return root->GetProperty(kRootWindowSettingsKey);
34 }
35
36 }  // namespace ash