OLD | NEW |
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 Loading... |
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::SysNSStringToWide(text), | 790 base::SysNSStringToUTF16(text), string16(), false, &match, NULL); |
791 std::wstring(), false, &match, NULL); | |
792 GURL url(match.destination_url); | 791 GURL url(match.destination_url); |
793 | 792 |
794 browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB, | 793 browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB, |
795 PageTransition::TYPED); | 794 PageTransition::TYPED); |
796 } | 795 } |
797 | 796 |
798 // (URLDropTargetController protocol) | 797 // (URLDropTargetController protocol) |
799 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { | 798 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { |
800 // Do nothing. | 799 // Do nothing. |
801 } | 800 } |
802 | 801 |
803 // (URLDropTargetController protocol) | 802 // (URLDropTargetController protocol) |
804 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 803 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
805 // Do nothing. | 804 // Do nothing. |
806 } | 805 } |
807 | 806 |
808 @end | 807 @end |
OLD | NEW |