| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1907 NSInteger index; | 1907 NSInteger index; |
| 1908 WindowOpenDisposition disposition; | 1908 WindowOpenDisposition disposition; |
| 1909 [self droppingURLsAt:point | 1909 [self droppingURLsAt:point |
| 1910 givesIndex:&index | 1910 givesIndex:&index |
| 1911 disposition:&disposition]; | 1911 disposition:&disposition]; |
| 1912 | 1912 |
| 1913 // Either insert a new tab or open in a current tab. | 1913 // Either insert a new tab or open in a current tab. |
| 1914 switch (disposition) { | 1914 switch (disposition) { |
| 1915 case NEW_FOREGROUND_TAB: { | 1915 case NEW_FOREGROUND_TAB: { |
| 1916 content::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs")); | 1916 content::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs")); |
| 1917 browser::NavigateParams params( | 1917 chrome::NavigateParams params(browser_, *url, |
| 1918 browser_, *url, content::PAGE_TRANSITION_TYPED); | 1918 content::PAGE_TRANSITION_TYPED); |
| 1919 params.disposition = disposition; | 1919 params.disposition = disposition; |
| 1920 params.tabstrip_index = index; | 1920 params.tabstrip_index = index; |
| 1921 params.tabstrip_add_types = | 1921 params.tabstrip_add_types = |
| 1922 TabStripModel::ADD_ACTIVE | TabStripModel::ADD_FORCE_INDEX; | 1922 TabStripModel::ADD_ACTIVE | TabStripModel::ADD_FORCE_INDEX; |
| 1923 browser::Navigate(¶ms); | 1923 chrome::Navigate(¶ms); |
| 1924 break; | 1924 break; |
| 1925 } | 1925 } |
| 1926 case CURRENT_TAB: { | 1926 case CURRENT_TAB: { |
| 1927 content::RecordAction(UserMetricsAction("Tab_DropURLOnTab")); | 1927 content::RecordAction(UserMetricsAction("Tab_DropURLOnTab")); |
| 1928 OpenURLParams params( | 1928 OpenURLParams params( |
| 1929 *url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); | 1929 *url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); |
| 1930 tabStripModel_->GetTabContentsAt(index)->web_contents()->OpenURL(params); | 1930 tabStripModel_->GetTabContentsAt(index)->web_contents()->OpenURL(params); |
| 1931 tabStripModel_->ActivateTabAt(index, true); | 1931 tabStripModel_->ActivateTabAt(index, true); |
| 1932 break; | 1932 break; |
| 1933 } | 1933 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2123 NSInteger index = [self indexFromModelIndex:modelIndex]; | 2123 NSInteger index = [self indexFromModelIndex:modelIndex]; |
| 2124 BrowserWindowController* controller = | 2124 BrowserWindowController* controller = |
| 2125 (BrowserWindowController*)[[switchView_ window] windowController]; | 2125 (BrowserWindowController*)[[switchView_ window] windowController]; |
| 2126 DCHECK(index >= 0); | 2126 DCHECK(index >= 0); |
| 2127 if (index >= 0) { | 2127 if (index >= 0) { |
| 2128 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 2128 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
| 2129 } | 2129 } |
| 2130 } | 2130 } |
| 2131 | 2131 |
| 2132 @end | 2132 @end |
| OLD | NEW |