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 18 matching lines...) Expand all Loading... |
29 class UI_EXPORT SelectionOwner { | 29 class UI_EXPORT SelectionOwner { |
30 public: | 30 public: |
31 SelectionOwner(Display* xdisplay, | 31 SelectionOwner(Display* xdisplay, |
32 ::Window xwindow, | 32 ::Window xwindow, |
33 ::Atom selection_name); | 33 ::Atom selection_name); |
34 ~SelectionOwner(); | 34 ~SelectionOwner(); |
35 | 35 |
36 // Returns the current selection data. Useful for fast paths. | 36 // Returns the current selection data. Useful for fast paths. |
37 SelectionFormatMap* selection_format_map() { return selection_data_.get(); } | 37 SelectionFormatMap* selection_format_map() { return selection_data_.get(); } |
38 | 38 |
| 39 // Retrieves a list of types we're offering. |
| 40 void RetrieveTargets(std::vector<Atom>* targets); |
| 41 |
39 // Attempts to take ownership of the selection. If we're successful, present | 42 // Attempts to take ownership of the selection. If we're successful, present |
40 // |data| to other windows. | 43 // |data| to other windows. |
41 void TakeOwnershipOfSelection(scoped_ptr<SelectionFormatMap> data); | 44 void TakeOwnershipOfSelection(scoped_ptr<SelectionFormatMap> data); |
42 | 45 |
43 // Releases the selection (if we own it) and clears any data we own. | 46 // Releases the selection (if we own it) and clears any data we own. |
44 void Clear(); | 47 void Clear(); |
45 | 48 |
46 // It is our owner's responsibility to plumb X11 events on |xwindow_| to us. | 49 // It is our owner's responsibility to plumb X11 events on |xwindow_| to us. |
47 void OnSelectionRequest(const XSelectionRequestEvent& event); | 50 void OnSelectionRequest(const XSelectionRequestEvent& event); |
48 void OnSelectionClear(const XSelectionClearEvent& event); | 51 void OnSelectionClear(const XSelectionClearEvent& event); |
(...skipping 12 matching lines...) Expand all Loading... |
61 scoped_ptr<SelectionFormatMap> selection_data_; | 64 scoped_ptr<SelectionFormatMap> selection_data_; |
62 | 65 |
63 X11AtomCache atom_cache_; | 66 X11AtomCache atom_cache_; |
64 | 67 |
65 DISALLOW_COPY_AND_ASSIGN(SelectionOwner); | 68 DISALLOW_COPY_AND_ASSIGN(SelectionOwner); |
66 }; | 69 }; |
67 | 70 |
68 } // namespace ui | 71 } // namespace ui |
69 | 72 |
70 #endif // UI_BASE_X_SELECTION_OWNER_H_ | 73 #endif // UI_BASE_X_SELECTION_OWNER_H_ |
OLD | NEW |