diff options
Diffstat (limited to 'chromium/ui/base/x/selection_owner.h')
-rw-r--r-- | chromium/ui/base/x/selection_owner.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chromium/ui/base/x/selection_owner.h b/chromium/ui/base/x/selection_owner.h index 8cecc621cc8..81d7e73a1f4 100644 --- a/chromium/ui/base/x/selection_owner.h +++ b/chromium/ui/base/x/selection_owner.h @@ -14,7 +14,7 @@ #include "base/basictypes.h" #include "base/callback.h" -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" #include "ui/base/x/selection_utils.h" #include "ui/gfx/x/x11_atom_cache.h" @@ -25,7 +25,7 @@ namespace ui { // The selection owner object keeps track of which xwindow is the current // owner, and when its |xwindow_|, offers different data types to other // processes. -class UI_EXPORT SelectionOwner { +class UI_BASE_EXPORT SelectionOwner { public: SelectionOwner(Display* xdisplay, ::Window xwindow, @@ -35,15 +35,16 @@ class UI_EXPORT SelectionOwner { // Returns the current selection data. Useful for fast paths. const SelectionFormatMap& selection_format_map() { return format_map_; } - // Retrieves a list of types we're offering. + // Appends a list of types we're offering to |targets|. void RetrieveTargets(std::vector<Atom>* targets); // Attempts to take ownership of the selection. If we're successful, present // |data| to other windows. void TakeOwnershipOfSelection(const SelectionFormatMap& data); - // Releases the selection (if we own it) and clears any data we own. - void Clear(); + // Clears our internal format map and clears the selection owner, whether we + // own the selection or not. + void ClearSelectionOwner(); // It is our owner's responsibility to plumb X11 events on |xwindow_| to us. void OnSelectionRequest(const XSelectionRequestEvent& event); @@ -52,6 +53,11 @@ class UI_EXPORT SelectionOwner { // don't, but there were open todos in the previous implementation. private: + // 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(::Atom target, ::Window requestor, ::Atom property); + // Our X11 state. Display* x_display_; ::Window x_window_; |