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

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

Issue 137783015: Merge 244538 "Don't populate URL data in WebDropData when draggi..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1750/src/
Patch Set: 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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 *formats = *formats | ui::OSExchangeData::URL; 798 *formats = *formats | ui::OSExchangeData::URL;
799 } 799 }
800 800
801 int OmniboxViewViews::OnDrop(const ui::OSExchangeData& data) { 801 int OmniboxViewViews::OnDrop(const ui::OSExchangeData& data) {
802 if (HasTextBeingDragged()) 802 if (HasTextBeingDragged())
803 return ui::DragDropTypes::DRAG_NONE; 803 return ui::DragDropTypes::DRAG_NONE;
804 804
805 if (data.HasURL()) { 805 if (data.HasURL()) {
806 GURL url; 806 GURL url;
807 base::string16 title; 807 base::string16 title;
808 if (data.GetURLAndTitle(&url, &title)) { 808 if (data.GetURLAndTitle(
809 ui::OSExchangeData::CONVERT_FILENAMES, &url, &title)) {
809 base::string16 text(StripJavascriptSchemas(UTF8ToUTF16(url.spec()))); 810 base::string16 text(StripJavascriptSchemas(UTF8ToUTF16(url.spec())));
810 if (model()->CanPasteAndGo(text)) { 811 if (model()->CanPasteAndGo(text)) {
811 model()->PasteAndGo(text); 812 model()->PasteAndGo(text);
812 return ui::DragDropTypes::DRAG_COPY; 813 return ui::DragDropTypes::DRAG_COPY;
813 } 814 }
814 } 815 }
815 } else if (data.HasString()) { 816 } else if (data.HasString()) {
816 base::string16 text; 817 base::string16 text;
817 if (data.GetString(&text)) { 818 if (data.GetString(&text)) {
818 base::string16 collapsed_text(CollapseWhitespace(text, true)); 819 base::string16 collapsed_text(CollapseWhitespace(text, true));
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 const base::string16 text(GetClipboardText()); 973 const base::string16 text(GetClipboardText());
973 if (!text.empty()) { 974 if (!text.empty()) {
974 // Record this paste, so we can do different behavior. 975 // Record this paste, so we can do different behavior.
975 model()->OnPaste(); 976 model()->OnPaste();
976 // Force a Paste operation to trigger the text_changed code in 977 // Force a Paste operation to trigger the text_changed code in
977 // OnAfterPossibleChange(), even if identical contents are pasted. 978 // OnAfterPossibleChange(), even if identical contents are pasted.
978 text_before_change_.clear(); 979 text_before_change_.clear();
979 InsertOrReplaceText(text); 980 InsertOrReplaceText(text);
980 } 981 }
981 } 982 }
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