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 | 8 |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // action list. | 138 // action list. |
139 int GetDragOperation() const; | 139 int GetDragOperation() const; |
140 | 140 |
141 private: | 141 private: |
142 // Masks the X11 atom |xdnd_operation|'s views representation onto | 142 // Masks the X11 atom |xdnd_operation|'s views representation onto |
143 // |drag_operation|. | 143 // |drag_operation|. |
144 void MaskOperation(::Atom xdnd_operation, int* drag_operation) const; | 144 void MaskOperation(::Atom xdnd_operation, int* drag_operation) const; |
145 | 145 |
146 // ui::PlatformEventDispatcher: | 146 // ui::PlatformEventDispatcher: |
147 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 147 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
148 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 148 virtual ui::PostDispatchAction DispatchEvent( |
| 149 const ui::PlatformEvent& event) override; |
149 | 150 |
150 // The atom cache owned by our parent. | 151 // The atom cache owned by our parent. |
151 ui::X11AtomCache* atom_cache_; | 152 ui::X11AtomCache* atom_cache_; |
152 | 153 |
153 // The XID of our chrome local aura window handling our events. | 154 // The XID of our chrome local aura window handling our events. |
154 ::Window local_window_; | 155 ::Window local_window_; |
155 | 156 |
156 // The XID of the window that's initiated the drag. | 157 // The XID of the window that's initiated the drag. |
157 unsigned long source_window_; | 158 unsigned long source_window_; |
158 | 159 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 *drag_operation |= ui::DragDropTypes::DRAG_MOVE; | 352 *drag_operation |= ui::DragDropTypes::DRAG_MOVE; |
352 else if (xdnd_operation == atom_cache_->GetAtom(kXdndActionLink)) | 353 else if (xdnd_operation == atom_cache_->GetAtom(kXdndActionLink)) |
353 *drag_operation |= ui::DragDropTypes::DRAG_LINK; | 354 *drag_operation |= ui::DragDropTypes::DRAG_LINK; |
354 } | 355 } |
355 | 356 |
356 bool DesktopDragDropClientAuraX11::X11DragContext::CanDispatchEvent( | 357 bool DesktopDragDropClientAuraX11::X11DragContext::CanDispatchEvent( |
357 const ui::PlatformEvent& event) { | 358 const ui::PlatformEvent& event) { |
358 return event->xany.window == source_window_; | 359 return event->xany.window == source_window_; |
359 } | 360 } |
360 | 361 |
361 uint32_t DesktopDragDropClientAuraX11::X11DragContext::DispatchEvent( | 362 ui::PostDispatchAction |
| 363 DesktopDragDropClientAuraX11::X11DragContext::DispatchEvent( |
362 const ui::PlatformEvent& event) { | 364 const ui::PlatformEvent& event) { |
363 if (event->type == PropertyNotify && | 365 if (event->type == PropertyNotify && |
364 event->xproperty.atom == atom_cache_->GetAtom("XdndActionList")) { | 366 event->xproperty.atom == atom_cache_->GetAtom("XdndActionList")) { |
365 ReadActions(); | 367 ReadActions(); |
366 return ui::POST_DISPATCH_STOP_PROPAGATION; | 368 return ui::POST_DISPATCH_STOP_PROPAGATION; |
367 } | 369 } |
368 return ui::POST_DISPATCH_NONE; | 370 return ui::POST_DISPATCH_NONE; |
369 } | 371 } |
370 | 372 |
371 /////////////////////////////////////////////////////////////////////////////// | 373 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 for (int x = 0; x < in_bitmap->width(); ++x) { | 1130 for (int x = 0; x < in_bitmap->width(); ++x) { |
1129 if (SkColorGetA(in_row[x]) > kMinAlpha) | 1131 if (SkColorGetA(in_row[x]) > kMinAlpha) |
1130 return true; | 1132 return true; |
1131 } | 1133 } |
1132 } | 1134 } |
1133 | 1135 |
1134 return false; | 1136 return false; |
1135 } | 1137 } |
1136 | 1138 |
1137 } // namespace views | 1139 } // namespace views |
OLD | NEW |