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/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 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 NSInteger index; | 1795 NSInteger index; |
1796 WindowOpenDisposition disposition; | 1796 WindowOpenDisposition disposition; |
1797 [self droppingURLsAt:point | 1797 [self droppingURLsAt:point |
1798 givesIndex:&index | 1798 givesIndex:&index |
1799 disposition:&disposition]; | 1799 disposition:&disposition]; |
1800 | 1800 |
1801 // Either insert a new tab or open in a current tab. | 1801 // Either insert a new tab or open in a current tab. |
1802 switch (disposition) { | 1802 switch (disposition) { |
1803 case NEW_FOREGROUND_TAB: { | 1803 case NEW_FOREGROUND_TAB: { |
1804 UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs")); | 1804 UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs")); |
1805 browser::NavigateParams params(browser_, *url, PageTransition::TYPED); | 1805 browser::NavigateParams params( |
| 1806 browser_, *url, content::PAGE_TRANSITION_TYPED); |
1806 params.disposition = disposition; | 1807 params.disposition = disposition; |
1807 params.tabstrip_index = index; | 1808 params.tabstrip_index = index; |
1808 params.tabstrip_add_types = | 1809 params.tabstrip_add_types = |
1809 TabStripModel::ADD_ACTIVE | TabStripModel::ADD_FORCE_INDEX; | 1810 TabStripModel::ADD_ACTIVE | TabStripModel::ADD_FORCE_INDEX; |
1810 browser::Navigate(¶ms); | 1811 browser::Navigate(¶ms); |
1811 break; | 1812 break; |
1812 } | 1813 } |
1813 case CURRENT_TAB: | 1814 case CURRENT_TAB: |
1814 UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab")); | 1815 UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab")); |
1815 tabStripModel_->GetTabContentsAt(index) | 1816 tabStripModel_->GetTabContentsAt(index) |
1816 ->tab_contents()->OpenURL(*url, GURL(), CURRENT_TAB, | 1817 ->tab_contents()->OpenURL(*url, GURL(), CURRENT_TAB, |
1817 PageTransition::TYPED); | 1818 content::PAGE_TRANSITION_TYPED); |
1818 tabStripModel_->ActivateTabAt(index, true); | 1819 tabStripModel_->ActivateTabAt(index, true); |
1819 break; | 1820 break; |
1820 default: | 1821 default: |
1821 NOTIMPLEMENTED(); | 1822 NOTIMPLEMENTED(); |
1822 } | 1823 } |
1823 } | 1824 } |
1824 | 1825 |
1825 // (URLDropTargetController protocol) | 1826 // (URLDropTargetController protocol) |
1826 - (void)dropURLs:(NSArray*)urls inView:(NSView*)view at:(NSPoint)point { | 1827 - (void)dropURLs:(NSArray*)urls inView:(NSView*)view at:(NSPoint)point { |
1827 DCHECK_EQ(view, tabStripView_.get()); | 1828 DCHECK_EQ(view, tabStripView_.get()); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2017 NSInteger index = [self indexFromModelIndex:modelIndex]; | 2018 NSInteger index = [self indexFromModelIndex:modelIndex]; |
2018 BrowserWindowController* controller = | 2019 BrowserWindowController* controller = |
2019 (BrowserWindowController*)[[switchView_ window] windowController]; | 2020 (BrowserWindowController*)[[switchView_ window] windowController]; |
2020 DCHECK(index >= 0); | 2021 DCHECK(index >= 0); |
2021 if (index >= 0) { | 2022 if (index >= 0) { |
2022 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 2023 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
2023 } | 2024 } |
2024 } | 2025 } |
2025 | 2026 |
2026 @end | 2027 @end |
OLD | NEW |