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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 | 1255 |
1256 // Relayout for new tabs and to let the selected tab grow to be larger in | 1256 // Relayout for new tabs and to let the selected tab grow to be larger in |
1257 // size than surrounding tabs if the user has many. This also raises the | 1257 // size than surrounding tabs if the user has many. This also raises the |
1258 // selected tab to the top. | 1258 // selected tab to the top. |
1259 [self layoutTabs]; | 1259 [self layoutTabs]; |
1260 | 1260 |
1261 // Swap in the contents for the new tab. | 1261 // Swap in the contents for the new tab. |
1262 [self swapInTabAtIndex:modelIndex]; | 1262 [self swapInTabAtIndex:modelIndex]; |
1263 | 1263 |
1264 if (newContents) { | 1264 if (newContents) { |
1265 newContents->web_contents()->WasRestored(); | 1265 newContents->web_contents()->WasShown(); |
1266 newContents->web_contents()->GetView()->RestoreFocus(); | 1266 newContents->web_contents()->GetView()->RestoreFocus(); |
1267 | 1267 |
1268 if (newContents->find_tab_helper()->find_ui_active()) | 1268 if (newContents->find_tab_helper()->find_ui_active()) |
1269 browser_->GetFindBarController()->find_bar()->SetFocusAndSelection(); | 1269 browser_->GetFindBarController()->find_bar()->SetFocusAndSelection(); |
1270 } | 1270 } |
1271 } | 1271 } |
1272 | 1272 |
1273 - (void)tabReplacedWithContents:(TabContents*)newContents | 1273 - (void)tabReplacedWithContents:(TabContents*)newContents |
1274 previousContents:(TabContents*)oldContents | 1274 previousContents:(TabContents*)oldContents |
1275 atIndex:(NSInteger)modelIndex { | 1275 atIndex:(NSInteger)modelIndex { |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 NSInteger index = [self indexFromModelIndex:modelIndex]; | 2121 NSInteger index = [self indexFromModelIndex:modelIndex]; |
2122 BrowserWindowController* controller = | 2122 BrowserWindowController* controller = |
2123 (BrowserWindowController*)[[switchView_ window] windowController]; | 2123 (BrowserWindowController*)[[switchView_ window] windowController]; |
2124 DCHECK(index >= 0); | 2124 DCHECK(index >= 0); |
2125 if (index >= 0) { | 2125 if (index >= 0) { |
2126 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 2126 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
2127 } | 2127 } |
2128 } | 2128 } |
2129 | 2129 |
2130 @end | 2130 @end |
OLD | NEW |