summaryrefslogtreecommitdiff
path: root/chromium/ui/base/x/selection_owner.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/base/x/selection_owner.h')
-rw-r--r--chromium/ui/base/x/selection_owner.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/chromium/ui/base/x/selection_owner.h b/chromium/ui/base/x/selection_owner.h
index a048133b9dd..0c715bd53d0 100644
--- a/chromium/ui/base/x/selection_owner.h
+++ b/chromium/ui/base/x/selection_owner.h
@@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "ui/base/x/selection_utils.h"
+#include "ui/gfx/x/event.h"
#include "ui/gfx/x/x11_types.h"
namespace ui {
@@ -33,16 +34,16 @@ COMPONENT_EXPORT(UI_BASE_X) extern const char kTargets[];
// processes.
class COMPONENT_EXPORT(UI_BASE_X) SelectionOwner {
public:
- SelectionOwner(XDisplay* xdisplay,
- XID xwindow,
- XAtom selection_name);
+ SelectionOwner(x11::Connection* connection,
+ x11::Window xwindow,
+ x11::Atom selection_name);
~SelectionOwner();
// Returns the current selection data. Useful for fast paths.
const SelectionFormatMap& selection_format_map() { return format_map_; }
// Appends a list of types we're offering to |targets|.
- void RetrieveTargets(std::vector<XAtom>* targets);
+ void RetrieveTargets(std::vector<x11::Atom>* targets);
// Attempts to take ownership of the selection. If we're successful, present
// |data| to other windows.
@@ -53,21 +54,21 @@ class COMPONENT_EXPORT(UI_BASE_X) SelectionOwner {
void ClearSelectionOwner();
// It is our owner's responsibility to plumb X11 events on |xwindow_| to us.
- void OnSelectionRequest(const XEvent& event);
- void OnSelectionClear(const XEvent& event);
+ void OnSelectionRequest(const x11::Event& event);
+ void OnSelectionClear(const x11::Event& event);
// Returns true if SelectionOwner can process the XPropertyEvent event,
// |event|.
- bool CanDispatchPropertyEvent(const XEvent& event);
+ bool CanDispatchPropertyEvent(const x11::Event& event);
- void OnPropertyEvent(const XEvent& event);
+ void OnPropertyEvent(const x11::Event& event);
private:
// Holds state related to an incremental data transfer.
struct IncrementalTransfer {
- IncrementalTransfer(XID window,
- XAtom target,
- XAtom property,
+ IncrementalTransfer(x11::Window window,
+ x11::Atom target,
+ x11::Atom property,
std::unique_ptr<XScopedEventSelector> event_selector,
const scoped_refptr<base::RefCountedMemory>& data,
int offset,
@@ -80,9 +81,9 @@ class COMPONENT_EXPORT(UI_BASE_X) SelectionOwner {
// Parameters from the XSelectionRequest. The data is transferred over
// |property| on |window|.
- XID window;
- XAtom target;
- XAtom property;
+ x11::Window window;
+ x11::Atom target;
+ x11::Atom property;
// Selects events on |window|.
std::unique_ptr<XScopedEventSelector> event_selector;
@@ -105,7 +106,9 @@ class COMPONENT_EXPORT(UI_BASE_X) SelectionOwner {
// Attempts to convert the selection to |target|. If the conversion is
// successful, true is returned and the result is stored in the |property|
// of |requestor|.
- bool ProcessTarget(XAtom target, XID requestor, XAtom property);
+ bool ProcessTarget(x11::Atom target,
+ x11::Window requestor,
+ x11::Atom property);
// Sends the next chunk of data for given the incremental data transfer.
void ProcessIncrementalTransfer(IncrementalTransfer* transfer);
@@ -120,17 +123,16 @@ class COMPONENT_EXPORT(UI_BASE_X) SelectionOwner {
// Returns the incremental data transfer, if any, which was waiting for
// |event|.
std::vector<IncrementalTransfer>::iterator FindIncrementalTransferForEvent(
- const XEvent& event);
+ const x11::Event& event);
// Our X11 state.
- XDisplay* x_display_;
- XID x_window_;
+ x11::Window x_window_;
// The X11 selection that this instance communicates on.
- XAtom selection_name_;
+ x11::Atom selection_name_;
// The time that this instance took ownership of its selection.
- Time acquired_selection_timestamp_;
+ uint32_t acquired_selection_timestamp_;
// The maximum size of data we can put in XChangeProperty().
size_t max_request_size_;