| 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 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 [self openURL:&url inView:view at:point]; | 1747 [self openURL:&url inView:view at:point]; |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 // (URLDropTargetController protocol) | 1750 // (URLDropTargetController protocol) |
| 1751 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 1751 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |
| 1752 DCHECK_EQ(view, tabStripView_.get()); | 1752 DCHECK_EQ(view, tabStripView_.get()); |
| 1753 | 1753 |
| 1754 // If the input is plain text, classify the input and make the URL. | 1754 // If the input is plain text, classify the input and make the URL. |
| 1755 AutocompleteMatch match; | 1755 AutocompleteMatch match; |
| 1756 browser_->profile()->GetAutocompleteClassifier()->Classify( | 1756 browser_->profile()->GetAutocompleteClassifier()->Classify( |
| 1757 base::SysNSStringToWide(text), | 1757 base::SysNSStringToUTF16(text), string16(), false, &match, NULL); |
| 1758 std::wstring(), false, &match, NULL); | |
| 1759 GURL url(match.destination_url); | 1758 GURL url(match.destination_url); |
| 1760 | 1759 |
| 1761 [self openURL:&url inView:view at:point]; | 1760 [self openURL:&url inView:view at:point]; |
| 1762 } | 1761 } |
| 1763 | 1762 |
| 1764 // (URLDropTargetController protocol) | 1763 // (URLDropTargetController protocol) |
| 1765 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { | 1764 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { |
| 1766 DCHECK_EQ(view, tabStripView_.get()); | 1765 DCHECK_EQ(view, tabStripView_.get()); |
| 1767 | 1766 |
| 1768 // The minimum y-coordinate at which one should consider place the arrow. | 1767 // 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... |
| 1895 NSInteger index = [self indexFromModelIndex:modelIndex]; | 1894 NSInteger index = [self indexFromModelIndex:modelIndex]; |
| 1896 BrowserWindowController* controller = | 1895 BrowserWindowController* controller = |
| 1897 (BrowserWindowController*)[[switchView_ window] windowController]; | 1896 (BrowserWindowController*)[[switchView_ window] windowController]; |
| 1898 DCHECK(index >= 0); | 1897 DCHECK(index >= 0); |
| 1899 if (index >= 0) { | 1898 if (index >= 0) { |
| 1900 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 1899 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
| 1901 } | 1900 } |
| 1902 } | 1901 } |
| 1903 | 1902 |
| 1904 @end | 1903 @end |
| OLD | NEW |