chore: cleanup drag_util (#36806)

chore: cleanup drag_util
This commit is contained in:
Shelley Vohr 2023-01-09 10:00:47 +01:00 committed by GitHub
parent 0d05273024
commit 1a9c338c92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 15 deletions

View file

@ -21,7 +21,11 @@ namespace electron {
void DragFileItems(const std::vector<base::FilePath>& files,
const gfx::Image& icon,
gfx::NativeView view) {
// Set up our OLE machinery
aura::Window* root_window = view->GetRootWindow();
if (!root_window || !aura::client::GetDragDropClient(root_window))
return;
// Set up our OLE machinery.
auto data = std::make_unique<ui::OSExchangeData>();
button_drag_utils::SetDragImage(GURL(), files[0].LossyDisplayName(),
@ -34,10 +38,6 @@ void DragFileItems(const std::vector<base::FilePath>& files,
}
data->SetFilenames(file_infos);
aura::Window* root_window = view->GetRootWindow();
if (!root_window || !aura::client::GetDragDropClient(root_window))
return;
gfx::Point location = display::Screen::GetScreen()->GetCursorScreenPoint();
// TODO(varunjain): Properly determine and send DragEventSource below.
aura::client::GetDragDropClient(root_window)