| 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::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 |
| OLD | NEW |