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 "app/mac/nsimage_cache.h" | 9 #include "app/mac/nsimage_cache.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 | 763 |
764 // (URLDropTargetController protocol) | 764 // (URLDropTargetController protocol) |
765 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 765 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |
766 // TODO(viettrungluu): This code is more or less copied from the code in | 766 // TODO(viettrungluu): This code is more or less copied from the code in |
767 // |TabStripController|. I'll refactor this soon to make it common and expand | 767 // |TabStripController|. I'll refactor this soon to make it common and expand |
768 // its capabilities (e.g., allow text DnD). | 768 // its capabilities (e.g., allow text DnD). |
769 | 769 |
770 // If the input is plain text, classify the input and make the URL. | 770 // If the input is plain text, classify the input and make the URL. |
771 AutocompleteMatch match; | 771 AutocompleteMatch match; |
772 browser_->profile()->GetAutocompleteClassifier()->Classify( | 772 browser_->profile()->GetAutocompleteClassifier()->Classify( |
773 base::SysNSStringToUTF16(text), string16(), false, &match, NULL); | 773 base::SysNSStringToUTF16(text), string16(), false, false, &match, NULL); |
774 GURL url(match.destination_url); | 774 GURL url(match.destination_url); |
775 | 775 |
776 browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB, | 776 browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB, |
777 PageTransition::TYPED); | 777 PageTransition::TYPED); |
778 } | 778 } |
779 | 779 |
780 // (URLDropTargetController protocol) | 780 // (URLDropTargetController protocol) |
781 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { | 781 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { |
782 // Do nothing. | 782 // Do nothing. |
783 } | 783 } |
784 | 784 |
785 // (URLDropTargetController protocol) | 785 // (URLDropTargetController protocol) |
786 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 786 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
787 // Do nothing. | 787 // Do nothing. |
788 } | 788 } |
789 | 789 |
790 @end | 790 @end |
OLD | NEW |