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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 6256010: Revert 72380 - Remove wstring from autocomplete.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/gtk/gtk_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "app/mac/nsimage_cache.h" 10 #include "app/mac/nsimage_cache.h"
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 780
781 // (URLDropTargetController protocol) 781 // (URLDropTargetController protocol)
782 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { 782 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point {
783 // TODO(viettrungluu): This code is more or less copied from the code in 783 // TODO(viettrungluu): This code is more or less copied from the code in
784 // |TabStripController|. I'll refactor this soon to make it common and expand 784 // |TabStripController|. I'll refactor this soon to make it common and expand
785 // its capabilities (e.g., allow text DnD). 785 // its capabilities (e.g., allow text DnD).
786 786
787 // If the input is plain text, classify the input and make the URL. 787 // If the input is plain text, classify the input and make the URL.
788 AutocompleteMatch match; 788 AutocompleteMatch match;
789 browser_->profile()->GetAutocompleteClassifier()->Classify( 789 browser_->profile()->GetAutocompleteClassifier()->Classify(
790 base::SysNSStringToUTF16(text), string16(), false, &match, NULL); 790 base::SysNSStringToWide(text),
791 std::wstring(), false, &match, NULL);
791 GURL url(match.destination_url); 792 GURL url(match.destination_url);
792 793
793 browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB, 794 browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB,
794 PageTransition::TYPED); 795 PageTransition::TYPED);
795 } 796 }
796 797
797 // (URLDropTargetController protocol) 798 // (URLDropTargetController protocol)
798 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { 799 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point {
799 // Do nothing. 800 // Do nothing.
800 } 801 }
801 802
802 // (URLDropTargetController protocol) 803 // (URLDropTargetController protocol)
803 - (void)hideDropURLsIndicatorInView:(NSView*)view { 804 - (void)hideDropURLsIndicatorInView:(NSView*)view {
804 // Do nothing. 805 // Do nothing.
805 } 806 }
806 807
807 @end 808 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/gtk/gtk_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698