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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ios/chrome/browser/tabs/tab_model_observers_bridge.h" 5 #import "ios/chrome/browser/tabs/tab_model_observers_bridge.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "ios/chrome/browser/tabs/legacy_tab_helper.h" 8 #import "ios/chrome/browser/tabs/legacy_tab_helper.h"
9 #import "ios/chrome/browser/tabs/tab_model.h" 9 #import "ios/chrome/browser/tabs/tab_model.h"
10 #import "ios/chrome/browser/tabs/tab_model_observers.h" 10 #import "ios/chrome/browser/tabs/tab_model_observers.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 - (void)webStateList:(WebStateList*)webStateList 68 - (void)webStateList:(WebStateList*)webStateList
69 didDetachWebState:(web::WebState*)webState 69 didDetachWebState:(web::WebState*)webState
70 atIndex:(int)index { 70 atIndex:(int)index {
71 DCHECK_GE(index, 0); 71 DCHECK_GE(index, 0);
72 [_tabModelObservers tabModel:_tabModel 72 [_tabModelObservers tabModel:_tabModel
73 didRemoveTab:LegacyTabHelper::GetTabForWebState(webState) 73 didRemoveTab:LegacyTabHelper::GetTabForWebState(webState)
74 atIndex:static_cast<NSUInteger>(index)]; 74 atIndex:static_cast<NSUInteger>(index)];
75 [_tabModelObservers tabModelDidChangeTabCount:_tabModel]; 75 [_tabModelObservers tabModelDidChangeTabCount:_tabModel];
76 } 76 }
77 77
78 - (void)webStateList:(WebStateList*)webStateList
79 didChangeActiveWebState:(web::WebState*)newWebState
80 oldWebState:(web::WebState*)oldWebState
81 atIndex:(int)atIndex
82 userAction:(BOOL)userAction {
83 DCHECK_GE(atIndex, 0);
84 if (!newWebState)
85 return;
86
87 Tab* oldTab =
88 oldWebState ? LegacyTabHelper::GetTabForWebState(oldWebState) : nil;
89 [_tabModelObservers tabModel:_tabModel
90 didChangeActiveTab:LegacyTabHelper::GetTabForWebState(newWebState)
91 previousTab:oldTab
92 atIndex:static_cast<NSUInteger>(atIndex)];
93 }
94
78 @end 95 @end
OLDNEW
« 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