Home | History | Annotate | Download | only in views
      1 // Copyright 2014 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/views/drag_utils.h"
      6 
      7 #include "ui/aura/window.h"
      8 #include "ui/aura/window_event_dispatcher.h"
      9 #include "ui/wm/public/drag_drop_client.h"
     10 
     11 namespace views {
     12 
     13 void RunShellDrag(gfx::NativeView view,
     14                   const ui::OSExchangeData& data,
     15                   const gfx::Point& location,
     16                   int operation,
     17                   ui::DragDropTypes::DragEventSource source) {
     18   gfx::Point root_location(location);
     19   aura::Window* root_window = view->GetRootWindow();
     20   aura::Window::ConvertPointToTarget(view, root_window, &root_location);
     21   if (aura::client::GetDragDropClient(root_window)) {
     22     aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
     23         data, root_window, view, root_location, operation, source);
     24   }
     25 }
     26 
     27 }  // namespace views
     28