pinned_mode_extension.cc 920 B

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