Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1544)

Unified Diff: ios/chrome/browser/tabs/tab_model_observers_bridge.mm

Issue 2703333006: Move the notion of current Tab from TabModel to WebStateList. (Closed)
Patch Set: Rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_order_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model_observers_bridge.mm
diff --git a/ios/chrome/browser/tabs/tab_model_observers_bridge.mm b/ios/chrome/browser/tabs/tab_model_observers_bridge.mm
index 76da2fca4ceb8226007b996089055235f28f7442..780f14739dac169e11625af34ac41f41b710bf1a 100644
--- a/ios/chrome/browser/tabs/tab_model_observers_bridge.mm
+++ b/ios/chrome/browser/tabs/tab_model_observers_bridge.mm
@@ -75,4 +75,21 @@
[_tabModelObservers tabModelDidChangeTabCount:_tabModel];
}
+- (void)webStateList:(WebStateList*)webStateList
+ didChangeActiveWebState:(web::WebState*)newWebState
+ oldWebState:(web::WebState*)oldWebState
+ atIndex:(int)atIndex
+ userAction:(BOOL)userAction {
+ DCHECK_GE(atIndex, 0);
+ if (!newWebState)
+ return;
+
+ Tab* oldTab =
+ oldWebState ? LegacyTabHelper::GetTabForWebState(oldWebState) : nil;
+ [_tabModelObservers tabModel:_tabModel
+ didChangeActiveTab:LegacyTabHelper::GetTabForWebState(newWebState)
+ previousTab:oldTab
+ atIndex:static_cast<NSUInteger>(atIndex)];
+}
+
@end
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_order_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698