system_modal_extension.cc 933 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2022 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 "ui/platform_window/extensions/system_modal_extension.h"
  5. #include "ui/base/class_property.h"
  6. #include "ui/platform_window/platform_window.h"
  7. DEFINE_UI_CLASS_PROPERTY_TYPE(ui::SystemModalExtension*)
  8. namespace ui {
  9. DEFINE_UI_CLASS_PROPERTY_KEY(SystemModalExtension*,
  10. kSystemModalExtensionKey,
  11. nullptr)
  12. SystemModalExtension::~SystemModalExtension() = default;
  13. void SystemModalExtension::SetSystemModalExtension(
  14. PlatformWindow* window,
  15. SystemModalExtension* extension) {
  16. window->SetProperty(kSystemModalExtensionKey, extension);
  17. }
  18. SystemModalExtension* GetSystemModalExtension(const PlatformWindow& window) {
  19. return window.GetProperty(kSystemModalExtensionKey);
  20. }
  21. } // namespace ui