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

Unified Diff: ios/shared/chrome/browser/tabs/web_state_list.mm

Issue 2768093003: [ios] Extend WebStateListObserver amd WebStateListDelegate APIs. (Closed)
Patch Set: Remove duplicated method. 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 side-by-side diff with in-line comments
Download patch
Index: ios/shared/chrome/browser/tabs/web_state_list.mm
diff --git a/ios/shared/chrome/browser/tabs/web_state_list.mm b/ios/shared/chrome/browser/tabs/web_state_list.mm
index c3614afa144465d94615e780bf5a5986a88e18c8..1ae68ba034f2b5addd39ed4475dc6f345c51b289 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list.mm
+++ b/ios/shared/chrome/browser/tabs/web_state_list.mm
@@ -214,6 +214,7 @@ web::WebState* WebStateList::ReplaceWebStateAt(int index,
for (auto& observer : observers_)
observer.WebStateReplacedAt(this, old_web_state, web_state, index);
+ delegate_->WebStateDetached(old_web_state);
return old_web_state;
}
@@ -222,6 +223,8 @@ web::WebState* WebStateList::DetachWebStateAt(int index) {
int new_active_index = order_controller_->DetermineNewActiveIndex(index);
web::WebState* old_web_state = web_state_wrappers_[index]->web_state();
+ for (auto& observer : observers_)
+ observer.WillDetachWebStateAt(this, old_web_state, index);
ClearOpenersReferencing(index);
web_state_wrappers_.erase(web_state_wrappers_.begin() + index);
@@ -241,6 +244,7 @@ web::WebState* WebStateList::DetachWebStateAt(int index) {
if (active_web_state_was_closed)
NotifyIfActiveWebStateChanged(old_web_state, false);
+ delegate_->WebStateDetached(old_web_state);
return old_web_state;
}

Powered by Google App Engine
This is Rietveld 408576698