drag_drop_client.cc 992 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2012 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/aura/client/drag_drop_client.h"
  5. #include "ui/aura/window.h"
  6. #include "ui/base/class_property.h"
  7. DEFINE_UI_CLASS_PROPERTY_TYPE(aura::client::DragDropClient*)
  8. namespace aura {
  9. namespace client {
  10. DEFINE_UI_CLASS_PROPERTY_KEY(DragDropClient*,
  11. kRootWindowDragDropClientKey,
  12. nullptr)
  13. void SetDragDropClient(Window* root_window, DragDropClient* client) {
  14. DCHECK_EQ(root_window->GetRootWindow(), root_window);
  15. root_window->SetProperty(kRootWindowDragDropClientKey, client);
  16. }
  17. DragDropClient* GetDragDropClient(Window* root_window) {
  18. if (root_window)
  19. DCHECK_EQ(root_window->GetRootWindow(), root_window);
  20. return root_window ?
  21. root_window->GetProperty(kRootWindowDragDropClientKey) : NULL;
  22. }
  23. } // namespace client
  24. } // namespace aura