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

Side by Side Diff: ios/chrome/browser/tabs/tab_model_observers_bridge.mm

Issue 2775623002: [ios] WebStateList owns all WebState it manages. (Closed)
Patch Set: Fix gn check Created 3 years, 8 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 DCHECK_GE(atIndex, 0); 89 DCHECK_GE(atIndex, 0);
90 90
91 Tab* oldTab = 91 Tab* oldTab =
92 oldWebState ? LegacyTabHelper::GetTabForWebState(oldWebState) : nil; 92 oldWebState ? LegacyTabHelper::GetTabForWebState(oldWebState) : nil;
93 [_tabModelObservers tabModel:_tabModel 93 [_tabModelObservers tabModel:_tabModel
94 didChangeActiveTab:LegacyTabHelper::GetTabForWebState(newWebState) 94 didChangeActiveTab:LegacyTabHelper::GetTabForWebState(newWebState)
95 previousTab:oldTab 95 previousTab:oldTab
96 atIndex:static_cast<NSUInteger>(atIndex)]; 96 atIndex:static_cast<NSUInteger>(atIndex)];
97 } 97 }
98 98
99 - (void)webStateList:(WebStateList*)webStateList
100 willDetachWebState:(web::WebState*)webState
101 atIndex:(int)atIndex {
102 DCHECK_GE(atIndex, 0);
103 [_tabModelObservers tabModel:_tabModel
104 willRemoveTab:LegacyTabHelper::GetTabForWebState(webState)];
105 }
106
99 @end 107 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab_model_closing_web_state_observer.mm ('k') | ios/chrome/browser/tabs/tab_model_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698