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

Unified Diff: ios/chrome/browser/tabs/tab_model_list.h

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/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_list.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model_list.h
diff --git a/ios/chrome/browser/tabs/tab_model_list.h b/ios/chrome/browser/tabs/tab_model_list.h
new file mode 100644
index 0000000000000000000000000000000000000000..bbba49029131339ef3b008a9f97ff20496068431
--- /dev/null
+++ b/ios/chrome/browser/tabs/tab_model_list.h
@@ -0,0 +1,37 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_TABS_TAB_MODEL_LIST_H_
+#define IOS_CHROME_BROWSER_TABS_TAB_MODEL_LIST_H_
+
+#import <Foundation/Foundation.h>
+
+// This file contains free functions to help maintain a 1:N relationship
+// between an ios::ChromeBrowserState and multiple TabModels.
+
+@class TabModel;
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+// Registers |tab_model| as associated to |browser_state|. The object will
+// be retained until |UnregisterTabModelFromChromeBrowserState| is called.
+// It is an error if |tab_model is already registered as associated to
+// |browser_state|.
+void RegisterTabModelWithChromeBrowserState(
+ ios::ChromeBrowserState* browser_state,
+ TabModel* tab_model);
+
+// Unregisters the association between |tab_model| and |browser_state|.
+// It is an error if no such association exists.
+void UnregisterTabModelFromChromeBrowserState(
+ ios::ChromeBrowserState* browser_state,
+ TabModel* tab_model);
+
+// Returns the list of all TabModels associated with |browser_state|.
+NSArray<TabModel*>* GetTabModelsForChromeBrowserState(
+ ios::ChromeBrowserState* browser_state);
+
+#endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_LIST_H_
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_list.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698