OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_TABS_TAB_MODEL_LIST_H_ |
| 6 #define IOS_CHROME_BROWSER_TABS_TAB_MODEL_LIST_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 // This file contains free functions to help maintain a 1:N relationship |
| 11 // between an ios::ChromeBrowserState and multiple TabModels. |
| 12 |
| 13 @class TabModel; |
| 14 |
| 15 namespace ios { |
| 16 class ChromeBrowserState; |
| 17 } |
| 18 |
| 19 // Registers |tab_model| as associated to |browser_state|. The object will |
| 20 // be retained until |UnregisterTabModelFromChromeBrowserState| is called. |
| 21 // It is an error if |tab_model is already registered as associated to |
| 22 // |browser_state|. |
| 23 void RegisterTabModelWithChromeBrowserState( |
| 24 ios::ChromeBrowserState* browser_state, |
| 25 TabModel* tab_model); |
| 26 |
| 27 // Unregisters the association between |tab_model| and |browser_state|. |
| 28 // It is an error if no such association exists. |
| 29 void UnregisterTabModelFromChromeBrowserState( |
| 30 ios::ChromeBrowserState* browser_state, |
| 31 TabModel* tab_model); |
| 32 |
| 33 // Returns the list of all TabModels associated with |browser_state|. |
| 34 NSArray<TabModel*>* GetTabModelsForChromeBrowserState( |
| 35 ios::ChromeBrowserState* browser_state); |
| 36 |
| 37 #endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_LIST_H_ |
OLD | NEW |