| 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 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" | 5 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 9 | 9 |
| 10 using content::WebContents; | 10 using content::WebContents; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 void TabStripModelObserverBridge::TabDetachedAt(WebContents* contents, | 55 void TabStripModelObserverBridge::TabDetachedAt(WebContents* contents, |
| 56 int index) { | 56 int index) { |
| 57 if ([controller_ respondsToSelector: | 57 if ([controller_ respondsToSelector: |
| 58 @selector(tabDetachedWithContents:atIndex:)]) { | 58 @selector(tabDetachedWithContents:atIndex:)]) { |
| 59 [controller_ tabDetachedWithContents:contents atIndex:index]; | 59 [controller_ tabDetachedWithContents:contents atIndex:index]; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 void TabStripModelObserverBridge::ActiveTabChanged( | 63 void TabStripModelObserverBridge::ActiveTabChanged(WebContents* old_contents, |
| 64 TabContents* old_contents, | 64 WebContents* new_contents, |
| 65 TabContents* new_contents, | 65 int index, |
| 66 int index, | 66 bool user_gesture) { |
| 67 bool user_gesture) { | |
| 68 if ([controller_ respondsToSelector: | 67 if ([controller_ respondsToSelector: |
| 69 @selector(activateTabWithContents:previousContents:atIndex: | 68 @selector(activateTabWithContents:previousContents:atIndex: |
| 70 userGesture:)]) { | 69 userGesture:)]) { |
| 71 [controller_ activateTabWithContents:WebContentsOf(new_contents) | 70 [controller_ activateTabWithContents:new_contents |
| 72 previousContents:WebContentsOf(old_contents) | 71 previousContents:old_contents |
| 73 atIndex:index | 72 atIndex:index |
| 74 userGesture:user_gesture]; | 73 userGesture:user_gesture]; |
| 75 } | 74 } |
| 76 } | 75 } |
| 77 | 76 |
| 78 void TabStripModelObserverBridge::TabMoved(TabContents* contents, | 77 void TabStripModelObserverBridge::TabMoved(TabContents* contents, |
| 79 int from_index, | 78 int from_index, |
| 80 int to_index) { | 79 int to_index) { |
| 81 if ([controller_ respondsToSelector: | 80 if ([controller_ respondsToSelector: |
| 82 @selector(tabMovedWithContents:fromIndex:toIndex:)]) { | 81 @selector(tabMovedWithContents:fromIndex:toIndex:)]) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 123 |
| 125 void TabStripModelObserverBridge::TabStripEmpty() { | 124 void TabStripModelObserverBridge::TabStripEmpty() { |
| 126 if ([controller_ respondsToSelector:@selector(tabStripEmpty)]) | 125 if ([controller_ respondsToSelector:@selector(tabStripEmpty)]) |
| 127 [controller_ tabStripEmpty]; | 126 [controller_ tabStripEmpty]; |
| 128 } | 127 } |
| 129 | 128 |
| 130 void TabStripModelObserverBridge::TabStripModelDeleted() { | 129 void TabStripModelObserverBridge::TabStripModelDeleted() { |
| 131 if ([controller_ respondsToSelector:@selector(tabStripModelDeleted)]) | 130 if ([controller_ respondsToSelector:@selector(tabStripModelDeleted)]) |
| 132 [controller_ tabStripModelDeleted]; | 131 [controller_ tabStripModelDeleted]; |
| 133 } | 132 } |
| OLD | NEW |