OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 const XClientMessageEvent& event) { | 600 const XClientMessageEvent& event) { |
601 DVLOG(1) << "XdndDrop"; | 601 DVLOG(1) << "XdndDrop"; |
602 | 602 |
603 unsigned long source_window = event.data.l[0]; | 603 unsigned long source_window = event.data.l[0]; |
604 | 604 |
605 int drag_operation = ui::DragDropTypes::DRAG_NONE; | 605 int drag_operation = ui::DragDropTypes::DRAG_NONE; |
606 if (target_window_) { | 606 if (target_window_) { |
607 aura::client::DragDropDelegate* delegate = | 607 aura::client::DragDropDelegate* delegate = |
608 aura::client::GetDragDropDelegate(target_window_); | 608 aura::client::GetDragDropDelegate(target_window_); |
609 if (delegate) { | 609 if (delegate) { |
610 ui::OSExchangeData data(new ui::OSExchangeDataProviderAuraX11( | 610 ui::OSExchangeData data( |
611 xwindow_, target_current_context_->fetched_targets())); | 611 base::MakeUnique<ui::OSExchangeDataProviderAuraX11>( |
| 612 xwindow_, target_current_context_->fetched_targets())); |
612 | 613 |
613 ui::DropTargetEvent event(data, | 614 ui::DropTargetEvent event(data, |
614 target_window_location_, | 615 target_window_location_, |
615 target_window_root_location_, | 616 target_window_root_location_, |
616 target_current_context_->GetDragOperation()); | 617 target_current_context_->GetDragOperation()); |
617 if (target_current_context_->source_client()) { | 618 if (target_current_context_->source_client()) { |
618 event.set_flags(target_current_context_->source_client() | 619 event.set_flags(target_current_context_->source_client() |
619 ->current_modifier_state()); | 620 ->current_modifier_state()); |
620 } else { | 621 } else { |
621 event.set_flags(XGetModifiers()); | 622 event.set_flags(XGetModifiers()); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 target_window_->AddObserver(this); | 975 target_window_->AddObserver(this); |
975 target_window_changed = true; | 976 target_window_changed = true; |
976 } | 977 } |
977 *delegate = NULL; | 978 *delegate = NULL; |
978 if (!target_window_) | 979 if (!target_window_) |
979 return; | 980 return; |
980 *delegate = aura::client::GetDragDropDelegate(target_window_); | 981 *delegate = aura::client::GetDragDropDelegate(target_window_); |
981 if (!*delegate) | 982 if (!*delegate) |
982 return; | 983 return; |
983 | 984 |
984 data->reset(new OSExchangeData(new ui::OSExchangeDataProviderAuraX11( | 985 data->reset(new OSExchangeData( |
985 xwindow_, target_current_context_->fetched_targets()))); | 986 base::MakeUnique<ui::OSExchangeDataProviderAuraX11>( |
| 987 xwindow_, target_current_context_->fetched_targets()))); |
986 gfx::Point location = root_location; | 988 gfx::Point location = root_location; |
987 aura::Window::ConvertPointToTarget(root_window_, target_window_, &location); | 989 aura::Window::ConvertPointToTarget(root_window_, target_window_, &location); |
988 | 990 |
989 target_window_location_ = location; | 991 target_window_location_ = location; |
990 target_window_root_location_ = root_location; | 992 target_window_root_location_ = root_location; |
991 | 993 |
992 int drag_op = target_current_context_->GetDragOperation(); | 994 int drag_op = target_current_context_->GetDragOperation(); |
993 // KDE-based file browsers such as Dolphin change the drag operation depending | 995 // KDE-based file browsers such as Dolphin change the drag operation depending |
994 // on whether alt/ctrl/shift was pressed. However once Chromium gets control | 996 // on whether alt/ctrl/shift was pressed. However once Chromium gets control |
995 // over the X11 events, the source application does no longer receive X11 | 997 // over the X11 events, the source application does no longer receive X11 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 for (int x = 0; x < in_bitmap->width(); ++x) { | 1230 for (int x = 0; x < in_bitmap->width(); ++x) { |
1229 if (SkColorGetA(in_row[x]) > kMinAlpha) | 1231 if (SkColorGetA(in_row[x]) > kMinAlpha) |
1230 return true; | 1232 return true; |
1231 } | 1233 } |
1232 } | 1234 } |
1233 | 1235 |
1234 return false; | 1236 return false; |
1235 } | 1237 } |
1236 | 1238 |
1237 } // namespace views | 1239 } // namespace views |
OLD | NEW |