OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/tab_strip_controller.h" | 5 #import "chrome/browser/cocoa/tab_strip_controller.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 } | 642 } |
643 | 643 |
644 // Swap in the contents for the new tab | 644 // Swap in the contents for the new tab |
645 [self swapInTabAtIndex:index]; | 645 [self swapInTabAtIndex:index]; |
646 | 646 |
647 if (newContents) { | 647 if (newContents) { |
648 newContents->DidBecomeSelected(); | 648 newContents->DidBecomeSelected(); |
649 newContents->view()->RestoreFocus(); | 649 newContents->view()->RestoreFocus(); |
650 | 650 |
651 if (newContents->find_ui_active()) | 651 if (newContents->find_ui_active()) |
652 browser_->find_bar()->find_bar()->SetFocusAndSelection(); | 652 browser_->GetFindBarController()->find_bar()->SetFocusAndSelection(); |
653 } | 653 } |
654 } | 654 } |
655 | 655 |
656 // Called when a notification is received from the model that the given tab | 656 // Called when a notification is received from the model that the given tab |
657 // has gone away. Remove all knowledge about this tab and it's associated | 657 // has gone away. Remove all knowledge about this tab and it's associated |
658 // controller and remove the view from the strip. | 658 // controller and remove the view from the strip. |
659 - (void)tabDetachedWithContents:(TabContents*)contents | 659 - (void)tabDetachedWithContents:(TabContents*)contents |
660 atIndex:(NSInteger)index { | 660 atIndex:(NSInteger)index { |
661 // Release the tab contents controller so those views get destroyed. This | 661 // Release the tab contents controller so those views get destroyed. This |
662 // will remove all the tab content Cocoa views from the hierarchy. A | 662 // will remove all the tab content Cocoa views from the hierarchy. A |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 BrowserWindowController* controller = | 1023 BrowserWindowController* controller = |
1024 (BrowserWindowController*)[[switchView_ window] windowController]; | 1024 (BrowserWindowController*)[[switchView_ window] windowController]; |
1025 DCHECK(index >= 0); | 1025 DCHECK(index >= 0); |
1026 if (index >= 0) { | 1026 if (index >= 0) { |
1027 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; | 1027 [controller setTab:[self viewAtIndex:index] isDraggable:YES]; |
1028 } | 1028 } |
1029 } | 1029 } |
1030 | 1030 |
1031 | 1031 |
1032 @end | 1032 @end |
OLD | NEW |