| 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 #include "chrome/browser/cocoa/tab_strip_model_observer_bridge.h" | 5 #include "chrome/browser/cocoa/tab_strip_model_observer_bridge.h" |
| 6 | 6 |
| 7 TabStripModelObserverBridge::TabStripModelObserverBridge(TabStripModel* model, | 7 TabStripModelObserverBridge::TabStripModelObserverBridge(TabStripModel* model, |
| 8 id controller) | 8 id controller) |
| 9 : controller_(controller), model_(model) { | 9 : controller_(controller), model_(model) { |
| 10 DCHECK(model && controller); | 10 DCHECK(model && controller); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 [controller_ tabMovedWithContents:contents | 68 [controller_ tabMovedWithContents:contents |
| 69 fromIndex:from_index | 69 fromIndex:from_index |
| 70 toIndex:to_index | 70 toIndex:to_index |
| 71 pinnedStateChanged:(pinned_state_changed ? YES : NO)]; | 71 pinnedStateChanged:(pinned_state_changed ? YES : NO)]; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 void TabStripModelObserverBridge::TabChangedAt(TabContents* contents, | 75 void TabStripModelObserverBridge::TabChangedAt(TabContents* contents, |
| 76 int index, | 76 int index, |
| 77 TabChangeType change_type) { | 77 TabChangeType change_type) { |
| 78 if (change_type == TITLE_NOT_LOADING) { | |
| 79 // TODO(sky): make this work. | |
| 80 // We'll receive another notification of the change asynchronously. | |
| 81 return; | |
| 82 } | |
| 83 if ([controller_ respondsToSelector: | 78 if ([controller_ respondsToSelector: |
| 84 @selector(tabChangedWithContents:atIndex:loadingOnly:)]) { | 79 @selector(tabChangedWithContents:atIndex:changeType:)]) { |
| 85 [controller_ tabChangedWithContents:contents | 80 [controller_ tabChangedWithContents:contents |
| 86 atIndex:index | 81 atIndex:index |
| 87 loadingOnly:change_type == LOADING_ONLY ? YES : NO]; | 82 changeType:change_type]; |
| 88 } | 83 } |
| 89 } | 84 } |
| 90 | 85 |
| 91 void TabStripModelObserverBridge::TabPinnedStateChanged(TabContents* contents, | 86 void TabStripModelObserverBridge::TabPinnedStateChanged(TabContents* contents, |
| 92 int index) { | 87 int index) { |
| 93 if ([controller_ respondsToSelector: | 88 if ([controller_ respondsToSelector: |
| 94 @selector(tabPinnedStateChangedWithContents:atIndex:)]) { | 89 @selector(tabPinnedStateChangedWithContents:atIndex:)]) { |
| 95 [controller_ tabPinnedStateChangedWithContents:contents | 90 [controller_ tabPinnedStateChangedWithContents:contents |
| 96 atIndex:index]; | 91 atIndex:index]; |
| 97 } | 92 } |
| 98 } | 93 } |
| 99 | 94 |
| 100 void TabStripModelObserverBridge::TabStripEmpty() { | 95 void TabStripModelObserverBridge::TabStripEmpty() { |
| 101 if ([controller_ respondsToSelector:@selector(tabStripEmpty)]) | 96 if ([controller_ respondsToSelector:@selector(tabStripEmpty)]) |
| 102 [controller_ tabStripEmpty]; | 97 [controller_ tabStripEmpty]; |
| 103 } | 98 } |
| OLD | NEW |