Chromium Code Reviews| Index: ui/base/x/selection_requestor.h |
| diff --git a/ui/base/x/selection_requestor.h b/ui/base/x/selection_requestor.h |
| index e092850532a546f655838e561defb430302af5e3..242c475280b6425998a6cbcd71021e5679b9e891 100644 |
| --- a/ui/base/x/selection_requestor.h |
| +++ b/ui/base/x/selection_requestor.h |
| @@ -15,10 +15,15 @@ |
| #include "base/basictypes.h" |
| #include "base/callback.h" |
| +#include "base/event_types.h" |
| #include "base/memory/ref_counted_memory.h" |
| #include "ui/base/ui_base_export.h" |
| #include "ui/gfx/x/x11_atom_cache.h" |
| +typedef unsigned long Atom; |
| +typedef unsigned long XID; |
| +typedef struct _XDisplay XDisplay; |
|
Daniel Erat
2014/07/16 03:03:13
can you include ui/gfx/x/x11_types.h instead (and
|
| + |
| namespace ui { |
| class PlatformEventDispatcher; |
| class SelectionData; |
| @@ -32,9 +37,9 @@ class SelectionData; |
| // implement per-component fast-paths. |
| class UI_BASE_EXPORT SelectionRequestor { |
| public: |
| - SelectionRequestor(Display* xdisplay, |
| - ::Window xwindow, |
| - ::Atom selection_name, |
| + SelectionRequestor(XDisplay* xdisplay, |
| + XID xwindow, |
| + Atom selection_name, |
| PlatformEventDispatcher* dispatcher); |
| ~SelectionRequestor(); |
| @@ -43,24 +48,24 @@ class UI_BASE_EXPORT SelectionRequestor { |
| // back. The result is stored in |out_data|. |
| // |out_data_items| is the length of |out_data| in |out_type| items. |
| bool PerformBlockingConvertSelection( |
| - ::Atom target, |
| + Atom target, |
| scoped_refptr<base::RefCountedMemory>* out_data, |
| size_t* out_data_items, |
| - ::Atom* out_type); |
| + Atom* out_type); |
| // Requests |target| from the selection that we handle, passing |parameter| |
| // as a parameter to XConvertSelection(). |
| void PerformBlockingConvertSelectionWithParameter( |
| - ::Atom target, |
| - const std::vector< ::Atom>& parameter); |
| + Atom target, |
| + const std::vector<Atom>& parameter); |
| // Returns the first of |types| offered by the current selection holder, or |
| // returns NULL if none of those types are available. |
| - SelectionData RequestAndWaitForTypes(const std::vector< ::Atom>& types); |
| + SelectionData RequestAndWaitForTypes(const std::vector<Atom>& types); |
| // It is our owner's responsibility to plumb X11 SelectionNotify events on |
| // |xwindow_| to us. |
| - void OnSelectionNotify(const XSelectionEvent& event); |
| + void OnSelectionNotify(const XEvent& event); |
| private: |
| // A request that has been issued and we are waiting for a response to. |
| @@ -70,7 +75,7 @@ class UI_BASE_EXPORT SelectionRequestor { |
| // Data to the current XConvertSelection request. Used for error detection; |
| // we verify it on the return message. |
| - ::Atom target; |
| + Atom target; |
| // Called to terminate the nested message loop. |
| base::Closure quit_closure; |
| @@ -79,7 +84,7 @@ class UI_BASE_EXPORT SelectionRequestor { |
| // success. If None, our request failed somehow. If equal to the property |
| // atom that we sent in the XConvertSelection call, we can read that |
| // property on |x_window_| for the requested data. |
| - ::Atom returned_property; |
| + Atom returned_property; |
| // Set to true when return_property is populated. |
| bool returned; |
| @@ -90,11 +95,11 @@ class UI_BASE_EXPORT SelectionRequestor { |
| void BlockTillSelectionNotifyForRequest(PendingRequest* request); |
| // Our X11 state. |
| - Display* x_display_; |
| - ::Window x_window_; |
| + XDisplay* x_display_; |
| + XID x_window_; |
| // The X11 selection that this instance communicates on. |
| - ::Atom selection_name_; |
| + Atom selection_name_; |
| // Dispatcher which handles SelectionNotify and SelectionRequest for |
| // |selection_name_|. PerformBlockingConvertSelection() calls the |