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