| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ |
| 6 #define UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ |
| 7 |
| 8 #include "ui/base/dragdrop/os_exchange_data.h" |
| 9 |
| 10 #include "ui/gfx/geometry/vector2d.h" |
| 11 #include "ui/gfx/image/image_skia.h" |
| 12 |
| 13 namespace views { |
| 14 |
| 15 class OSExchangeDataProviderMus : public ui::OSExchangeData::Provider { |
| 16 public: |
| 17 OSExchangeDataProviderMus(); |
| 18 ~OSExchangeDataProviderMus() override; |
| 19 |
| 20 // Overridden from OSExchangeData::Provider: |
| 21 std::unique_ptr<Provider> Clone() const override; |
| 22 |
| 23 void MarkOriginatedFromRenderer() override; |
| 24 bool DidOriginateFromRenderer() const override; |
| 25 |
| 26 void SetString(const base::string16& data) override; |
| 27 void SetURL(const GURL& url, const base::string16& title) override; |
| 28 void SetFilename(const base::FilePath& path) override; |
| 29 void SetFilenames(const std::vector<ui::FileInfo>& file_names) override; |
| 30 void SetPickledData(const ui::Clipboard::FormatType& format, |
| 31 const base::Pickle& data) override; |
| 32 |
| 33 bool GetString(base::string16* data) const override; |
| 34 bool GetURLAndTitle(ui::OSExchangeData::FilenameToURLPolicy policy, |
| 35 GURL* url, |
| 36 base::string16* title) const override; |
| 37 bool GetFilename(base::FilePath* path) const override; |
| 38 bool GetFilenames(std::vector<ui::FileInfo>* file_names) const override; |
| 39 bool GetPickledData(const ui::Clipboard::FormatType& format, |
| 40 base::Pickle* data) const override; |
| 41 |
| 42 bool HasString() const override; |
| 43 bool HasURL(ui::OSExchangeData::FilenameToURLPolicy policy) const override; |
| 44 bool HasFile() const override; |
| 45 bool HasCustomFormat(const ui::Clipboard::FormatType& format) const override; |
| 46 |
| 47 // Provider doesn't have a consistent interface between operating systems; |
| 48 // this wasn't seen as a problem when there was a single Provider subclass |
| 49 // per operating system. Now we have to have at least two providers per OS, |
| 50 // leading to the following warts, which will remain until we clean all the |
| 51 // callsites up. |
| 52 #if (!defined(OS_CHROMEOS) && defined(USE_X11)) || defined(OS_WIN) |
| 53 void SetFileContents(const base::FilePath& filename, |
| 54 const std::string& file_contents) override; |
| 55 #endif |
| 56 #if defined(OS_WIN) |
| 57 bool GetFileContents(base::FilePath* filename, |
| 58 std::string* file_contents) const override; |
| 59 bool HasFileContents() const override; |
| 60 void SetDownloadFileInfo( |
| 61 const ui::OSExchangeData::DownloadFileInfo& download) override; |
| 62 #endif |
| 63 |
| 64 #if defined(USE_AURA) |
| 65 void SetHtml(const base::string16& html, const GURL& base_url) override; |
| 66 bool GetHtml(base::string16* html, GURL* base_url) const override; |
| 67 bool HasHtml() const override; |
| 68 #endif |
| 69 |
| 70 #if defined(USE_AURA) || defined(OS_MACOSX) |
| 71 void SetDragImage(const gfx::ImageSkia& image, |
| 72 const gfx::Vector2d& cursor_offset) override; |
| 73 const gfx::ImageSkia& GetDragImage() const override; |
| 74 const gfx::Vector2d& GetDragImageOffset() const override; |
| 75 #endif |
| 76 |
| 77 private: |
| 78 // Drag image and offset data. |
| 79 gfx::ImageSkia drag_image_; |
| 80 gfx::Vector2d drag_image_offset_; |
| 81 |
| 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMus); |
| 84 }; |
| 85 |
| 86 } // namespace views |
| 87 |
| 88 #endif // UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ |
| OLD | NEW |