| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 DesktopDragDropClientAuraX11* | 102 DesktopDragDropClientAuraX11* |
| 103 DesktopDragDropClientAuraX11::g_current_drag_drop_client = NULL; | 103 DesktopDragDropClientAuraX11::g_current_drag_drop_client = NULL; |
| 104 | 104 |
| 105 class DesktopDragDropClientAuraX11::X11DragContext | 105 class DesktopDragDropClientAuraX11::X11DragContext |
| 106 : public ui::PlatformEventDispatcher { | 106 : public ui::PlatformEventDispatcher { |
| 107 public: | 107 public: |
| 108 X11DragContext(ui::X11AtomCache* atom_cache, | 108 X11DragContext(ui::X11AtomCache* atom_cache, |
| 109 ::Window local_window, | 109 ::Window local_window, |
| 110 const XClientMessageEvent& event); | 110 const XClientMessageEvent& event); |
| 111 virtual ~X11DragContext(); | 111 ~X11DragContext() override; |
| 112 | 112 |
| 113 // When we receive an XdndPosition message, we need to have all the data | 113 // When we receive an XdndPosition message, we need to have all the data |
| 114 // copied from the other window before we process the XdndPosition | 114 // copied from the other window before we process the XdndPosition |
| 115 // message. If we have that data already, dispatch immediately. Otherwise, | 115 // message. If we have that data already, dispatch immediately. Otherwise, |
| 116 // delay dispatching until we do. | 116 // delay dispatching until we do. |
| 117 void OnStartXdndPositionMessage(DesktopDragDropClientAuraX11* client, | 117 void OnStartXdndPositionMessage(DesktopDragDropClientAuraX11* client, |
| 118 ::Atom suggested_action, | 118 ::Atom suggested_action, |
| 119 ::Window source_window, | 119 ::Window source_window, |
| 120 const gfx::Point& screen_point); | 120 const gfx::Point& screen_point); |
| 121 | 121 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 137 // Creates a ui::DragDropTypes::DragOperation representation of the current | 137 // Creates a ui::DragDropTypes::DragOperation representation of the current |
| 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 bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
| 148 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 148 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; |
| 149 | 149 |
| 150 // The atom cache owned by our parent. | 150 // The atom cache owned by our parent. |
| 151 ui::X11AtomCache* atom_cache_; | 151 ui::X11AtomCache* atom_cache_; |
| 152 | 152 |
| 153 // The XID of our chrome local aura window handling our events. | 153 // The XID of our chrome local aura window handling our events. |
| 154 ::Window local_window_; | 154 ::Window local_window_; |
| 155 | 155 |
| 156 // The XID of the window that's initiated the drag. | 156 // The XID of the window that's initiated the drag. |
| 157 unsigned long source_window_; | 157 unsigned long source_window_; |
| 158 | 158 |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 for (int x = 0; x < in_bitmap->width(); ++x) { | 1140 for (int x = 0; x < in_bitmap->width(); ++x) { |
| 1141 if (SkColorGetA(in_row[x]) > kMinAlpha) | 1141 if (SkColorGetA(in_row[x]) > kMinAlpha) |
| 1142 return true; | 1142 return true; |
| 1143 } | 1143 } |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 return false; | 1146 return false; |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 } // namespace views | 1149 } // namespace views |
| OLD | NEW |