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_REQUESTOR_H_ | 5 #ifndef UI_BASE_X_SELECTION_REQUESTOR_H_ |
6 #define UI_BASE_X_SELECTION_REQUESTOR_H_ | 6 #define UI_BASE_X_SELECTION_REQUESTOR_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 20 matching lines...) Expand all Loading... |
31 // API. SelectionRequestor should only deal with the X11 details; it does not | 31 // API. SelectionRequestor should only deal with the X11 details; it does not |
32 // implement per-component fast-paths. | 32 // implement per-component fast-paths. |
33 class UI_BASE_EXPORT SelectionRequestor { | 33 class UI_BASE_EXPORT SelectionRequestor { |
34 public: | 34 public: |
35 SelectionRequestor(XDisplay* xdisplay, | 35 SelectionRequestor(XDisplay* xdisplay, |
36 XID xwindow, | 36 XID xwindow, |
37 PlatformEventDispatcher* dispatcher); | 37 PlatformEventDispatcher* dispatcher); |
38 ~SelectionRequestor(); | 38 ~SelectionRequestor(); |
39 | 39 |
40 // Does the work of requesting |target| from |selection|, spinning up the | 40 // Does the work of requesting |target| from |selection|, spinning up the |
41 // nested message loop, and reading the resulting data back. The result is | 41 // nested run loop, and reading the resulting data back. The result is |
42 // stored in |out_data|. | 42 // stored in |out_data|. |
43 // |out_data_items| is the length of |out_data| in |out_type| items. | 43 // |out_data_items| is the length of |out_data| in |out_type| items. |
44 bool PerformBlockingConvertSelection( | 44 bool PerformBlockingConvertSelection( |
45 XAtom selection, | 45 XAtom selection, |
46 XAtom target, | 46 XAtom target, |
47 scoped_refptr<base::RefCountedMemory>* out_data, | 47 scoped_refptr<base::RefCountedMemory>* out_data, |
48 size_t* out_data_items, | 48 size_t* out_data_items, |
49 XAtom* out_type); | 49 XAtom* out_type); |
50 | 50 |
51 // Requests |target| from |selection|, passing |parameter| as a parameter to | 51 // Requests |target| from |selection|, passing |parameter| as a parameter to |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 std::vector<scoped_refptr<base::RefCountedMemory> > out_data; | 91 std::vector<scoped_refptr<base::RefCountedMemory> > out_data; |
92 size_t out_data_items; | 92 size_t out_data_items; |
93 XAtom out_type; | 93 XAtom out_type; |
94 | 94 |
95 // Whether the XConvertSelection() request was successful. | 95 // Whether the XConvertSelection() request was successful. |
96 bool success; | 96 bool success; |
97 | 97 |
98 // The time when the request should be aborted. | 98 // The time when the request should be aborted. |
99 base::TimeTicks timeout; | 99 base::TimeTicks timeout; |
100 | 100 |
101 // Called to terminate the nested message loop. | 101 // Called to terminate the nested run loop. |
102 base::Closure quit_closure; | 102 base::Closure quit_closure; |
103 | 103 |
104 // True if the request is complete. | 104 // True if the request is complete. |
105 bool completed; | 105 bool completed; |
106 }; | 106 }; |
107 | 107 |
108 // Aborts requests which have timed out. | 108 // Aborts requests which have timed out. |
109 void AbortStaleRequests(); | 109 void AbortStaleRequests(); |
110 | 110 |
111 // Mark |request| as completed. If the current request is completed, converts | 111 // Mark |request| as completed. If the current request is completed, converts |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 base::RepeatingTimer abort_timer_; | 151 base::RepeatingTimer abort_timer_; |
152 | 152 |
153 X11AtomCache atom_cache_; | 153 X11AtomCache atom_cache_; |
154 | 154 |
155 DISALLOW_COPY_AND_ASSIGN(SelectionRequestor); | 155 DISALLOW_COPY_AND_ASSIGN(SelectionRequestor); |
156 }; | 156 }; |
157 | 157 |
158 } // namespace ui | 158 } // namespace ui |
159 | 159 |
160 #endif // UI_BASE_X_SELECTION_REQUESTOR_H_ | 160 #endif // UI_BASE_X_SELECTION_REQUESTOR_H_ |
OLD | NEW |