diff options
Diffstat (limited to 'chromium/ui/base/dragdrop/os_exchange_data_provider_aurax11.h')
-rw-r--r-- | chromium/ui/base/dragdrop/os_exchange_data_provider_aurax11.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/chromium/ui/base/dragdrop/os_exchange_data_provider_aurax11.h b/chromium/ui/base/dragdrop/os_exchange_data_provider_aurax11.h index 76cfad3a97c..702cc7e11e6 100644 --- a/chromium/ui/base/dragdrop/os_exchange_data_provider_aurax11.h +++ b/chromium/ui/base/dragdrop/os_exchange_data_provider_aurax11.h @@ -13,12 +13,12 @@ #include <map> #include "base/files/file_path.h" -#include "base/message_loop/message_pump_dispatcher.h" #include "base/pickle.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/x/selection_owner.h" #include "ui/base/x/selection_requestor.h" #include "ui/base/x/selection_utils.h" +#include "ui/events/platform/platform_event_dispatcher.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/vector2d.h" #include "ui/gfx/x/x11_atom_cache.h" @@ -27,11 +27,12 @@ namespace ui { class Clipboard; +class OSExchangeDataProviderAuraX11Test; // OSExchangeData::Provider implementation for aura on linux. -class UI_EXPORT OSExchangeDataProviderAuraX11 +class UI_BASE_EXPORT OSExchangeDataProviderAuraX11 : public OSExchangeData::Provider, - public base::MessagePumpDispatcher { + public ui::PlatformEventDispatcher { public: // |x_window| is the window the cursor is over, and |selection| is the set of // data being offered. @@ -55,28 +56,38 @@ class UI_EXPORT OSExchangeDataProviderAuraX11 // Makes a copy of the format map currently being offered. SelectionFormatMap GetFormatMap() const; + const base::FilePath& file_contents_name() const { + return file_contents_name_; + } + // Overridden from OSExchangeData::Provider: virtual Provider* Clone() const OVERRIDE; + virtual void MarkOriginatedFromRenderer() OVERRIDE; + virtual bool DidOriginateFromRenderer() const OVERRIDE; virtual void SetString(const base::string16& data) OVERRIDE; virtual void SetURL(const GURL& url, const base::string16& title) OVERRIDE; virtual void SetFilename(const base::FilePath& path) OVERRIDE; - virtual void SetFilenames( - const std::vector<OSExchangeData::FileInfo>& filenames) OVERRIDE; + virtual void SetFilenames(const std::vector<FileInfo>& filenames) OVERRIDE; virtual void SetPickledData(const OSExchangeData::CustomFormat& format, const Pickle& pickle) OVERRIDE; virtual bool GetString(base::string16* data) const OVERRIDE; - virtual bool GetURLAndTitle(GURL* url, base::string16* title) const OVERRIDE; + virtual bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy, + GURL* url, + base::string16* title) const OVERRIDE; virtual bool GetFilename(base::FilePath* path) const OVERRIDE; - virtual bool GetFilenames( - std::vector<OSExchangeData::FileInfo>* filenames) const OVERRIDE; + virtual bool GetFilenames(std::vector<FileInfo>* filenames) const OVERRIDE; virtual bool GetPickledData(const OSExchangeData::CustomFormat& format, Pickle* pickle) const OVERRIDE; virtual bool HasString() const OVERRIDE; - virtual bool HasURL() const OVERRIDE; + virtual bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const + OVERRIDE; virtual bool HasFile() const OVERRIDE; virtual bool HasCustomFormat(const OSExchangeData::CustomFormat& format) const OVERRIDE; + virtual void SetFileContents(const base::FilePath& filename, + const std::string& file_contents) OVERRIDE; + virtual void SetHtml(const base::string16& html, const GURL& base_url) OVERRIDE; virtual bool GetHtml(base::string16* html, GURL* base_url) const OVERRIDE; @@ -86,10 +97,12 @@ class UI_EXPORT OSExchangeDataProviderAuraX11 virtual const gfx::ImageSkia& GetDragImage() const OVERRIDE; virtual const gfx::Vector2d& GetDragImageOffset() const OVERRIDE; - // Overridden from base::MessagePumpDispatcher: - virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; + // ui::PlatformEventDispatcher: + virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE; + virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE; private: + friend class OSExchangeDataProviderAuraX11Test; typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData; // Returns true if |formats_| contains a string format and the string can be @@ -124,6 +137,9 @@ class UI_EXPORT OSExchangeDataProviderAuraX11 // to |selection_owner_| when we take the selection. SelectionFormatMap format_map_; + // Auxilary data for the X Direct Save protocol. + base::FilePath file_contents_name_; + // Takes a snapshot of |format_map_| and offers it to other windows. mutable SelectionOwner selection_owner_; |