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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 2323273003: Ignore Javascript urls dropped on tabs (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 7800dc987e5ae98dd56dfdc7a7189dc17e99408a..32fed77ae6278fe117926f102c259e4b3999d06d 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1629,6 +1629,9 @@ int TabStrip::OnDragUpdated(const DropTargetEvent& event) {
if (!drop_info_->file_supported)
return ui::DragDropTypes::DRAG_NONE;
+ if ((drop_info_->url).SchemeIs(url::kJavaScriptScheme))
Peter Kasting 2016/09/09 20:43:06 Nit: Remove unnecessary first set of parens. Comb
elawrence 2016/09/12 21:42:58 Done.
+ return ui::DragDropTypes::DRAG_NONE;
+
return GetDropEffect(event);
}
@@ -1654,7 +1657,8 @@ int TabStrip::OnPerformDrop(const DropTargetEvent& event) {
if (!file_supported ||
!event.data().GetURLAndTitle(
ui::OSExchangeData::CONVERT_FILENAMES, &url, &title) ||
- !url.is_valid())
+ !url.is_valid() ||
+ url.SchemeIs(url::kJavaScriptScheme))
return ui::DragDropTypes::DRAG_NONE;
controller_->PerformDrop(drop_before, drop_index, url);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698