Chromium Code Reviews| 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..99e1ec554b7e120261d350a29a60c38fe1f40002 |
| --- /dev/null |
| +++ b/ios/chrome/browser/tabs/tab_model_list.h |
| @@ -0,0 +1,35 @@ |
| +// 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 function to help maintain 1:N relationship |
|
marq (ping after 24h)
2017/01/11 15:56:47
"free functions to help maintain a 1:N relationshi
sdefresne
2017/01/11 16:14:42
Done.
|
| +// 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. |
|
marq (ping after 24h)
2017/01/11 15:56:47
Add: "it is an error if |tab_model is already regi
sdefresne
2017/01/11 16:14:42
Done.
|
| +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_ |