root_window_settings.cc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/root_window_settings.h"
  5. #include "ui/aura/window.h"
  6. #include "ui/aura/window_event_dispatcher.h"
  7. #include "ui/base/class_property.h"
  8. #include "ui/display/types/display_constants.h"
  9. DEFINE_UI_CLASS_PROPERTY_TYPE(ash::RootWindowSettings*)
  10. namespace ash {
  11. DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(RootWindowSettings,
  12. kRootWindowSettingsKey,
  13. NULL)
  14. RootWindowSettings::RootWindowSettings()
  15. : display_id(display::kInvalidDisplayId), controller(NULL) {}
  16. RootWindowSettings* InitRootWindowSettings(aura::Window* root) {
  17. RootWindowSettings* settings = new RootWindowSettings();
  18. root->SetProperty(kRootWindowSettingsKey, settings);
  19. return settings;
  20. }
  21. RootWindowSettings* GetRootWindowSettings(aura::Window* root) {
  22. return root->GetProperty(kRootWindowSettingsKey);
  23. }
  24. const RootWindowSettings* GetRootWindowSettings(const aura::Window* root) {
  25. return root->GetProperty(kRootWindowSettingsKey);
  26. }
  27. } // namespace ash