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

Unified Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 6462009: Allow dragging and dropping of URLs to any portion of the toolbar view.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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: chrome/browser/ui/views/toolbar_view.cc
===================================================================
--- chrome/browser/ui/views/toolbar_view.cc (revision 74430)
+++ chrome/browser/ui/views/toolbar_view.cc (working copy)
@@ -607,6 +607,20 @@
canvas->FillRectInt(SK_ColorBLACK, 0, height() - 1, width(), 1);
}
+bool ToolbarView::CanDrop(const ui::OSExchangeData& data) {
+ // To support loading URLs by dropping into the toolbar, we need to support
+ // dropping URLs and/or text.
+ return data.HasURL() || data.HasString();
+}
+
+int ToolbarView::OnDragUpdated(const views::DropTargetEvent& event) {
+ return ui::DragDropTypes::DRAG_COPY;
sky 2011/02/11 01:06:07 I think you should allow move or link too. But, yo
Roger Tawa OOO till Jul 10th 2011/02/11 15:20:17 Changed to support either copy or link, just like
sky 2011/02/11 17:14:53 Fair enough, but shouldn't we ignore the drop enti
Roger Tawa OOO till Jul 10th 2011/02/11 21:35:26 If the drop is on the edit itself, it uses its own
sky 2011/02/11 23:18:50 If you drag the url from the omnibox it won't allo
+}
+
+int ToolbarView::OnPerformDrop(const views::DropTargetEvent& event) {
+ return location_bar_->location_entry()->OnPerformDrop(event);
+}
+
void ToolbarView::OnThemeChanged() {
LoadImages();
}

Powered by Google App Engine
This is Rietveld 408576698