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

Unified Diff: ui/base/dragdrop/os_exchange_data.h

Issue 2322253004: Drag and dropping text, parsable as url (Closed)
Patch Set: initial patch for windows Created 4 years, 3 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.h
diff --git a/ui/base/dragdrop/os_exchange_data.h b/ui/base/dragdrop/os_exchange_data.h
index 683197de275155f86cc1006e2747d221abd83d19..8b287e503bbb2da20eb9a63e23f928d48a84845e 100644
--- a/ui/base/dragdrop/os_exchange_data.h
+++ b/ui/base/dragdrop/os_exchange_data.h
@@ -70,6 +70,13 @@ class UI_BASE_EXPORT OSExchangeData {
// getting a URL.
enum FilenameToURLPolicy { CONVERT_FILENAMES, DO_NOT_CONVERT_FILENAMES, };
+ // Controls whether or not to attempt to parse dragged text as URL when
+ // getting a URL.
+ enum URLTextParsePolicy {
+ PARSE_TEXT_AS_URL,
+ DO_NOT_PARSE_TEXT_AS_URL,
+ };
+
// Encapsulates the info about a file to be downloaded.
struct UI_BASE_EXPORT DownloadFileInfo {
DownloadFileInfo(const base::FilePath& filename,
@@ -184,7 +191,8 @@ class UI_BASE_EXPORT OSExchangeData {
// GetString() returns the plain text representation of the pasteboard
// contents.
bool GetString(base::string16* data) const;
- bool GetURLAndTitle(FilenameToURLPolicy policy,
+ bool GetURLAndTitle(FilenameToURLPolicy,
+ URLTextParsePolicy,
GURL* url,
base::string16* title) const;
// Return the path of a file, if available.
@@ -196,7 +204,7 @@ class UI_BASE_EXPORT OSExchangeData {
// Test whether or not data of certain types is present, without actually
// returning anything.
bool HasString() const;
- bool HasURL(FilenameToURLPolicy policy) const;
+ bool HasURL(FilenameToURLPolicy, URLTextParsePolicy) const;
bool HasFile() const;
bool HasCustomFormat(const Clipboard::FormatType& format) const;

Powered by Google App Engine
This is Rietveld 408576698