Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: ui/views/mus/os_exchange_data_provider_mus.h

Issue 2211253002: mus/views: Create a mus OSExchangeData::Provider stub, and use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK. Fixed unit tests? Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/BUILD.gn ('k') | ui/views/mus/os_exchange_data_provider_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/os_exchange_data_provider_mus.h
diff --git a/ui/views/mus/os_exchange_data_provider_mus.h b/ui/views/mus/os_exchange_data_provider_mus.h
new file mode 100644
index 0000000000000000000000000000000000000000..7d47dd55245b66559954c846884fda53cb5c289d
--- /dev/null
+++ b/ui/views/mus/os_exchange_data_provider_mus.h
@@ -0,0 +1,88 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_
+#define UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_
+
+#include "ui/base/dragdrop/os_exchange_data.h"
+
+#include "ui/gfx/geometry/vector2d.h"
+#include "ui/gfx/image/image_skia.h"
+
+namespace views {
+
+class OSExchangeDataProviderMus : public ui::OSExchangeData::Provider {
+ public:
+ OSExchangeDataProviderMus();
+ ~OSExchangeDataProviderMus() override;
+
+ // Overridden from OSExchangeData::Provider:
+ std::unique_ptr<Provider> Clone() const override;
+
+ void MarkOriginatedFromRenderer() override;
+ bool DidOriginateFromRenderer() const override;
+
+ void SetString(const base::string16& data) override;
+ void SetURL(const GURL& url, const base::string16& title) override;
+ void SetFilename(const base::FilePath& path) override;
+ void SetFilenames(const std::vector<ui::FileInfo>& file_names) override;
+ void SetPickledData(const ui::Clipboard::FormatType& format,
+ const base::Pickle& data) override;
+
+ bool GetString(base::string16* data) const override;
+ bool GetURLAndTitle(ui::OSExchangeData::FilenameToURLPolicy policy,
+ GURL* url,
+ base::string16* title) const override;
+ bool GetFilename(base::FilePath* path) const override;
+ bool GetFilenames(std::vector<ui::FileInfo>* file_names) const override;
+ bool GetPickledData(const ui::Clipboard::FormatType& format,
+ base::Pickle* data) const override;
+
+ bool HasString() const override;
+ bool HasURL(ui::OSExchangeData::FilenameToURLPolicy policy) const override;
+ bool HasFile() const override;
+ bool HasCustomFormat(const ui::Clipboard::FormatType& format) const override;
+
+ // Provider doesn't have a consistent interface between operating systems;
+ // this wasn't seen as a problem when there was a single Provider subclass
+ // per operating system. Now we have to have at least two providers per OS,
+ // leading to the following warts, which will remain until we clean all the
+ // callsites up.
+#if (!defined(OS_CHROMEOS) && defined(USE_X11)) || defined(OS_WIN)
+ void SetFileContents(const base::FilePath& filename,
+ const std::string& file_contents) override;
+#endif
+#if defined(OS_WIN)
+ bool GetFileContents(base::FilePath* filename,
+ std::string* file_contents) const override;
+ bool HasFileContents() const override;
+ void SetDownloadFileInfo(
+ const ui::OSExchangeData::DownloadFileInfo& download) override;
+#endif
+
+#if defined(USE_AURA)
+ void SetHtml(const base::string16& html, const GURL& base_url) override;
+ bool GetHtml(base::string16* html, GURL* base_url) const override;
+ bool HasHtml() const override;
+#endif
+
+#if defined(USE_AURA) || defined(OS_MACOSX)
+ void SetDragImage(const gfx::ImageSkia& image,
+ const gfx::Vector2d& cursor_offset) override;
+ const gfx::ImageSkia& GetDragImage() const override;
+ const gfx::Vector2d& GetDragImageOffset() const override;
+#endif
+
+ private:
+ // Drag image and offset data.
+ gfx::ImageSkia drag_image_;
+ gfx::Vector2d drag_image_offset_;
+
+
+ DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMus);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_
« no previous file with comments | « ui/views/mus/BUILD.gn ('k') | ui/views/mus/os_exchange_data_provider_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698