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

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

Issue 2621083003: Implement 1:N mapping from ios::ChromeBrowserState to TabModel. (Closed)
Patch Set: Use NSMutableSet<TabModel*>* to hold the TabModels. Created 3 years, 11 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/BUILD.gn ('k') | ios/chrome/browser/tabs/tab_model_list.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.mm
diff --git a/ios/chrome/browser/tabs/tab_model.mm b/ios/chrome/browser/tabs/tab_model.mm
index 8bfb11ff0019ca53c27e4c26c2a8d227b9ce37f9..aa4cd9a93b6ded6d85a11f2ac00b0feecfecdb49 100644
--- a/ios/chrome/browser/tabs/tab_model.mm
+++ b/ios/chrome/browser/tabs/tab_model.mm
@@ -30,6 +30,7 @@
#import "ios/chrome/browser/snapshots/snapshot_cache.h"
#include "ios/chrome/browser/tab_parenting_global_observer.h"
#import "ios/chrome/browser/tabs/tab.h"
+#import "ios/chrome/browser/tabs/tab_model_list.h"
#import "ios/chrome/browser/tabs/tab_model_observer.h"
#import "ios/chrome/browser/tabs/tab_model_order_controller.h"
#import "ios/chrome/browser/tabs/tab_model_synced_window_delegate.h"
@@ -299,6 +300,9 @@ void CleanCertificatePolicyCache(
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];
+
+ // Associate with ios::ChromeBrowserState.
+ RegisterTabModelWithChromeBrowserState(_browserState, self);
}
return self;
}
@@ -732,6 +736,9 @@ void CleanCertificatePolicyCache(
// NOTE: This can be called multiple times, so must be robust against that.
- (void)browserStateDestroyed {
[[NSNotificationCenter defaultCenter] removeObserver:self];
+ if (_browserState) {
+ UnregisterTabModelFromChromeBrowserState(_browserState, self);
+ }
_browserState = nullptr;
}
« no previous file with comments | « ios/chrome/browser/tabs/BUILD.gn ('k') | ios/chrome/browser/tabs/tab_model_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698