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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 135633002: Don't populate URL data in WebDropData when dragging files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Blink style enums Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 *formats = *formats | ui::OSExchangeData::URL; 850 *formats = *formats | ui::OSExchangeData::URL;
851 } 851 }
852 852
853 int OmniboxViewViews::OnDrop(const ui::OSExchangeData& data) { 853 int OmniboxViewViews::OnDrop(const ui::OSExchangeData& data) {
854 if (HasTextBeingDragged()) 854 if (HasTextBeingDragged())
855 return ui::DragDropTypes::DRAG_NONE; 855 return ui::DragDropTypes::DRAG_NONE;
856 856
857 if (data.HasURL()) { 857 if (data.HasURL()) {
858 GURL url; 858 GURL url;
859 base::string16 title; 859 base::string16 title;
860 if (data.GetURLAndTitle(&url, &title)) { 860 if (data.GetURLAndTitle(
861 ui::OSExchangeData::CONVERT_FILENAMES, &url, &title)) {
861 base::string16 text( 862 base::string16 text(
862 StripJavascriptSchemas(base::UTF8ToUTF16(url.spec()))); 863 StripJavascriptSchemas(base::UTF8ToUTF16(url.spec())));
863 if (model()->CanPasteAndGo(text)) { 864 if (model()->CanPasteAndGo(text)) {
864 model()->PasteAndGo(text); 865 model()->PasteAndGo(text);
865 return ui::DragDropTypes::DRAG_COPY; 866 return ui::DragDropTypes::DRAG_COPY;
866 } 867 }
867 } 868 }
868 } else if (data.HasString()) { 869 } else if (data.HasString()) {
869 base::string16 text; 870 base::string16 text;
870 if (data.GetString(&text)) { 871 if (data.GetString(&text)) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 const base::string16 text(GetClipboardText()); 976 const base::string16 text(GetClipboardText());
976 if (!text.empty()) { 977 if (!text.empty()) {
977 // Record this paste, so we can do different behavior. 978 // Record this paste, so we can do different behavior.
978 model()->OnPaste(); 979 model()->OnPaste();
979 // Force a Paste operation to trigger the text_changed code in 980 // Force a Paste operation to trigger the text_changed code in
980 // OnAfterPossibleChange(), even if identical contents are pasted. 981 // OnAfterPossibleChange(), even if identical contents are pasted.
981 text_before_change_.clear(); 982 text_before_change_.clear();
982 InsertOrReplaceText(text); 983 InsertOrReplaceText(text);
983 } 984 }
984 } 985 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_root_view.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698