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

Unified Diff: ui/base/dragdrop/os_exchange_data_provider_android.cc

Issue 1728193002: Support dragging texts into Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 years, 10 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
Index: ui/base/dragdrop/os_exchange_data_provider_android.cc
diff --git a/ui/base/dragdrop/os_exchange_data_provider_android.cc b/ui/base/dragdrop/os_exchange_data_provider_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9a97c422de6276f2199afa45dafa48d6f7ddd5d9
--- /dev/null
+++ b/ui/base/dragdrop/os_exchange_data_provider_android.cc
@@ -0,0 +1,102 @@
+// 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.
+
+#include "ui/base/dragdrop/os_exchange_data_provider_android.h"
+
+namespace ui {
+
+OSExchangeDataProviderAndroid::OSExchangeDataProviderAndroid() {}
+
+OSExchangeDataProviderAndroid::~OSExchangeDataProviderAndroid() {}
+
+OSExchangeData::Provider* OSExchangeDataProviderAndroid::Clone() const {
+ OSExchangeDataProviderAndroid* provider = new OSExchangeDataProviderAndroid();
+ provider->string_ = string_;
+
+ return provider;
+}
+
+void OSExchangeDataProviderAndroid::MarkOriginatedFromRenderer() {
+ // no-op.
Ted C 2016/02/25 18:38:53 should all of these be marked as NOTIMPLEMENTED()
hush (inactive) 2016/02/27 01:46:14 yes. That would be good to catch any unexpected ca
+}
+
+bool OSExchangeDataProviderAndroid::DidOriginateFromRenderer() const {
+ return false;
+}
+
+void OSExchangeDataProviderAndroid::SetString(const base::string16& string) {
+ string_ = string;
+}
+
+void OSExchangeDataProviderAndroid::SetURL(const GURL& url,
+ const base::string16& title) {
+ // no op
+}
+
+void OSExchangeDataProviderAndroid::SetFilename(const base::FilePath& path) {
+ // no op
+}
+
+void OSExchangeDataProviderAndroid::SetFilenames(
+ const std::vector<ui::FileInfo>& filenames) {
+ // no op
+}
+
+void OSExchangeDataProviderAndroid::SetPickledData(
+ const ui::Clipboard::FormatType& format,
+ const base::Pickle& pickle) {
+ // no op.
+}
+
+bool OSExchangeDataProviderAndroid::GetString(base::string16* string) const {
+ *string = string_;
+ return string_.size() > 0;
aelias_OOO_until_Jul13 2016/02/25 20:58:00 !string_.empty() (likewise in HasString())
hush (inactive) 2016/02/27 01:46:14 I changed the logic a little. I used a format_ int
+}
+
+bool OSExchangeDataProviderAndroid::GetURLAndTitle(
+ ui::OSExchangeData::FilenameToURLPolicy policy,
+ GURL* url,
+ base::string16* title) const {
+ return false;
+}
+
+bool OSExchangeDataProviderAndroid::GetFilename(base::FilePath* path) const {
+ return false;
+}
+
+bool OSExchangeDataProviderAndroid::GetFilenames(
+ std::vector<ui::FileInfo>* filenames) const {
+ return false;
+}
+
+bool OSExchangeDataProviderAndroid::GetPickledData(
+ const ui::Clipboard::FormatType& format,
+ base::Pickle* pickle) const {
+ return false;
+}
+
+bool OSExchangeDataProviderAndroid::HasString() const {
+ return string_.size() > 0;
+}
+
+bool OSExchangeDataProviderAndroid::HasURL(
+ ui::OSExchangeData::FilenameToURLPolicy policy) const {
+ return false;
+}
+
+bool OSExchangeDataProviderAndroid::HasFile() const {
+ return false;
+}
+
+bool OSExchangeDataProviderAndroid::HasCustomFormat(
+ const ui::Clipboard::FormatType& format) const {
+ return false;
+}
+
+// static
+OSExchangeData::Provider* OSExchangeData::CreateProvider() {
+ return new OSExchangeDataProviderAndroid();
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698