OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tabs/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 [self openURL:&url inView:view at:point]; | 1746 [self openURL:&url inView:view at:point]; |
1747 } | 1747 } |
1748 | 1748 |
1749 // (URLDropTargetController protocol) | 1749 // (URLDropTargetController protocol) |
1750 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 1750 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |
1751 DCHECK_EQ(view, tabStripView_.get()); | 1751 DCHECK_EQ(view, tabStripView_.get()); |
1752 | 1752 |
1753 // If the input is plain text, classify the input and make the URL. | 1753 // If the input is plain text, classify the input and make the URL. |
1754 AutocompleteMatch match; | 1754 AutocompleteMatch match; |
1755 browser_->profile()->GetAutocompleteClassifier()->Classify( | 1755 browser_->profile()->GetAutocompleteClassifier()->Classify( |
1756 base::SysNSStringToWide(text), | 1756 base::SysNSStringToUTF16(text), string16(), false, &match, NULL); |
1757 std::wstring(), false, &match, NULL); | |
1758 GURL url(match.destination_url); | 1757 GURL url(match.destination_url); |
1759 | 1758 |
1760 [self openURL:&url inView:view at:point]; | 1759 [self openURL:&url inView:view at:point]; |
1761 } | 1760 } |
1762 | 1761 |
1763 // (URLDropTargetController protocol) | 1762 // (URLDropTargetController protocol) |
1764 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { | 1763 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { |
1765 DCHECK_EQ(view, tabStripView_.get()); | 1764 DCHECK_EQ(view, tabStripView_.get()); |
1766 | 1765 |
1767 // The minimum y-coordinate at which one should consider place the arrow. | 1766 // The minimum y-coordinate at which one should consider place the arrow. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1893 NSInteger index = [self indexFromModelIndex:modelIndex]; |
1895 BrowserWindowController* controller = | 1894 BrowserWindowController* controller = |
1896 (BrowserWindowController*)[[switchView_ window] windowController]; | 1895 (BrowserWindowController*)[[switchView_ window] windowController]; |
1897 DCHECK(index >= 0); | 1896 DCHECK(index >= 0); |
1898 if (index >= 0) { | 1897 if (index >= 0) { |
1899 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 1898 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
1900 } | 1899 } |
1901 } | 1900 } |
1902 | 1901 |
1903 @end | 1902 @end |
OLD | NEW |