| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef UI_BASE_X_SELECTION_OWNER_H_ | 5 #ifndef UI_BASE_X_SELECTION_OWNER_H_ |
| 6 #define UI_BASE_X_SELECTION_OWNER_H_ | 6 #define UI_BASE_X_SELECTION_OWNER_H_ |
| 7 | 7 |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class UI_BASE_EXPORT SelectionOwner { | 28 class UI_BASE_EXPORT SelectionOwner { |
| 29 public: | 29 public: |
| 30 SelectionOwner(Display* xdisplay, | 30 SelectionOwner(Display* xdisplay, |
| 31 ::Window xwindow, | 31 ::Window xwindow, |
| 32 ::Atom selection_name); | 32 ::Atom selection_name); |
| 33 ~SelectionOwner(); | 33 ~SelectionOwner(); |
| 34 | 34 |
| 35 // Returns the current selection data. Useful for fast paths. | 35 // Returns the current selection data. Useful for fast paths. |
| 36 const SelectionFormatMap& selection_format_map() { return format_map_; } | 36 const SelectionFormatMap& selection_format_map() { return format_map_; } |
| 37 | 37 |
| 38 // Retrieves a list of types we're offering. | 38 // Appends a list of types we're offering to |targets|. |
| 39 void RetrieveTargets(std::vector<Atom>* targets); | 39 void RetrieveTargets(std::vector<Atom>* targets); |
| 40 | 40 |
| 41 // Attempts to take ownership of the selection. If we're successful, present | 41 // Attempts to take ownership of the selection. If we're successful, present |
| 42 // |data| to other windows. | 42 // |data| to other windows. |
| 43 void TakeOwnershipOfSelection(const SelectionFormatMap& data); | 43 void TakeOwnershipOfSelection(const SelectionFormatMap& data); |
| 44 | 44 |
| 45 // Releases the selection (if we own it) and clears any data we own. | 45 // Releases the selection (if we own it) and clears any data we own. |
| 46 void Clear(); | 46 void Clear(); |
| 47 | 47 |
| 48 // It is our owner's responsibility to plumb X11 events on |xwindow_| to us. | 48 // It is our owner's responsibility to plumb X11 events on |xwindow_| to us. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 63 SelectionFormatMap format_map_; | 63 SelectionFormatMap format_map_; |
| 64 | 64 |
| 65 X11AtomCache atom_cache_; | 65 X11AtomCache atom_cache_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(SelectionOwner); | 67 DISALLOW_COPY_AND_ASSIGN(SelectionOwner); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace ui | 70 } // namespace ui |
| 71 | 71 |
| 72 #endif // UI_BASE_X_SELECTION_OWNER_H_ | 72 #endif // UI_BASE_X_SELECTION_OWNER_H_ |
| OLD | NEW |