namespace views {
+DesktopDragDropClientAuraX11*
+DesktopDragDropClientAuraX11::g_current_drag_drop_client = NULL;
+
class DesktopDragDropClientAuraX11::X11DragContext :
public base::MessagePumpDispatcher {
public:
private:
// Overridden from MessagePumpDispatcher:
- virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
+ virtual uint32_t Dispatch(const base::NativeEvent& event) OVERRIDE;
// The atom cache owned by our parent.
ui::X11AtomCache* atom_cache_;
return drag_operation;
}
-bool DesktopDragDropClientAuraX11::X11DragContext::Dispatch(
+uint32_t DesktopDragDropClientAuraX11::X11DragContext::Dispatch(
const base::NativeEvent& event) {
if (event->type == PropertyNotify &&
event->xproperty.atom == atom_cache_->GetAtom("XdndActionList")) {
ReadActions();
}
- return true;
+ return POST_DISPATCH_NONE;
}
///////////////////////////////////////////////////////////////////////////////
target_window_(NULL),
source_provider_(NULL),
source_current_window_(None),
- drag_drop_in_progress_(false),
drag_operation_(0),
resulting_operation_(0),
grab_cursor_(cursor_manager->GetInitializedCursor(ui::kCursorGrabbing)),
int operation,
ui::DragDropTypes::DragEventSource source) {
source_current_window_ = None;
- drag_drop_in_progress_ = true;
+ DCHECK(!g_current_drag_drop_client);
+ g_current_drag_drop_client = this;
drag_operation_ = operation;
resulting_operation_ = ui::DragDropTypes::DRAG_NONE;
move_loop_.SetDragImage(gfx::ImageSkia(), gfx::Vector2dF());
source_provider_ = NULL;
- drag_drop_in_progress_ = false;
+ g_current_drag_drop_client = NULL;
drag_operation_ = 0;
XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList"));
}
bool DesktopDragDropClientAuraX11::IsDragDropInProgress() {
- return drag_drop_in_progress_;
+ return !!g_current_drag_drop_client;
}
void DesktopDragDropClientAuraX11::OnWindowDestroyed(aura::Window* window) {