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

Unified Diff: chrome/browser/ui/views/toolbar/home_button.cc

Issue 2014733003: Removing parsing of text from pasteboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moving url parsing up the hierarchy Created 4 years, 7 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: chrome/browser/ui/views/toolbar/home_button.cc
diff --git a/chrome/browser/ui/views/toolbar/home_button.cc b/chrome/browser/ui/views/toolbar/home_button.cc
index 2a2e682674f52ad1dc19991b879a03222c80a334..2972a17b3302ec70ae3e8197caf19405fd714a31 100644
--- a/chrome/browser/ui/views/toolbar/home_button.cc
+++ b/chrome/browser/ui/views/toolbar/home_button.cc
@@ -159,7 +159,8 @@ bool HomeButton::GetDropFormats(
}
bool HomeButton::CanDrop(const OSExchangeData& data) {
- return data.HasURL(ui::OSExchangeData::CONVERT_FILENAMES);
+ return data.HasURL(ui::OSExchangeData::CONVERT_FILENAMES,
+ ui::OSExchangeData::PARSE_TEXT_AS_URL);
}
int HomeButton::OnDragUpdated(const ui::DropTargetEvent& event) {
@@ -169,8 +170,9 @@ int HomeButton::OnDragUpdated(const ui::DropTargetEvent& event) {
int HomeButton::OnPerformDrop(const ui::DropTargetEvent& event) {
GURL new_homepage_url;
base::string16 title;
- if (event.data().GetURLAndTitle(
- ui::OSExchangeData::CONVERT_FILENAMES, &new_homepage_url, &title) &&
+ if (event.data().GetURLAndTitle(ui::OSExchangeData::CONVERT_FILENAMES,
+ ui::OSExchangeData::PARSE_TEXT_AS_URL,
+ &new_homepage_url, &title) &&
new_homepage_url.is_valid()) {
PrefService* prefs = browser_->profile()->GetPrefs();
bool old_is_ntp = prefs->GetBoolean(prefs::kHomePageIsNewTabPage);

Powered by Google App Engine
This is Rietveld 408576698