| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_ | 5 #ifndef IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_ |
| 6 #define IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_ | 6 #define IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #import <UIKit/UIKit.h> | 9 #import <UIKit/UIKit.h> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 inBackground:(BOOL)inBackground; | 188 inBackground:(BOOL)inBackground; |
| 189 | 189 |
| 190 // As above, but using WebLoadParams to specify various optional parameters. | 190 // As above, but using WebLoadParams to specify various optional parameters. |
| 191 - (Tab*)insertTabWithLoadParams: | 191 - (Tab*)insertTabWithLoadParams: |
| 192 (const web::NavigationManager::WebLoadParams&)params | 192 (const web::NavigationManager::WebLoadParams&)params |
| 193 opener:(Tab*)parentTab | 193 opener:(Tab*)parentTab |
| 194 openedByDOM:(BOOL)openedByDOM | 194 openedByDOM:(BOOL)openedByDOM |
| 195 atIndex:(NSUInteger)index | 195 atIndex:(NSUInteger)index |
| 196 inBackground:(BOOL)inBackground; | 196 inBackground:(BOOL)inBackground; |
| 197 | 197 |
| 198 // Inserts a new tab at the given |index| with the session history specified by | |
| 199 // |webState|. Does not go through the order controller as this is generally | |
| 200 // used only for restoring a previous session and the index is fixed. | |
| 201 - (Tab*)insertTabWithWebState:(std::unique_ptr<web::WebState>)webState | |
| 202 atIndex:(NSUInteger)index; | |
| 203 | |
| 204 // Inserts |tab| at the given |index|. Broadcasts the proper notifications about | |
| 205 // the change. The receiver should be set as the parentTabModel for |tab|; this | |
| 206 // method doesn't check that. | |
| 207 - (void)insertTab:(Tab*)tab atIndex:(NSUInteger)index; | |
| 208 | |
| 209 // Moves |tab| to the given |index|. |index| must be valid for this tab model | 198 // Moves |tab| to the given |index|. |index| must be valid for this tab model |
| 210 // (must be less than the current number of tabs). |tab| must already be in this | 199 // (must be less than the current number of tabs). |tab| must already be in this |
| 211 // tab model. If |tab| is already at |index|, this method does nothing and will | 200 // tab model. If |tab| is already at |index|, this method does nothing and will |
| 212 // not notify observers. | 201 // not notify observers. |
| 213 - (void)moveTab:(Tab*)tab toIndex:(NSUInteger)index; | 202 - (void)moveTab:(Tab*)tab toIndex:(NSUInteger)index; |
| 214 | 203 |
| 215 // Replaces |oldTab| in the model with |newTab|. Closes the oldTab when | |
| 216 // replacing it in the model. | |
| 217 - (void)replaceTab:(Tab*)oldTab withTab:(Tab*)newTab; | |
| 218 | |
| 219 // Closes the tab at the given |index|. |index| must be valid. | 204 // Closes the tab at the given |index|. |index| must be valid. |
| 220 - (void)closeTabAtIndex:(NSUInteger)index; | 205 - (void)closeTabAtIndex:(NSUInteger)index; |
| 221 | 206 |
| 222 // Closes the given tab. | 207 // Closes the given tab. |
| 223 - (void)closeTab:(Tab*)tab; | 208 - (void)closeTab:(Tab*)tab; |
| 224 | 209 |
| 225 // Closes ALL the tabs. | 210 // Closes ALL the tabs. |
| 226 - (void)closeAllTabs; | 211 - (void)closeAllTabs; |
| 227 | 212 |
| 228 // Halts all tabs (terminating active requests) without closing them. Used | 213 // Halts all tabs (terminating active requests) without closing them. Used |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 - (void)setPrimary:(BOOL)primary; | 247 - (void)setPrimary:(BOOL)primary; |
| 263 | 248 |
| 264 // Returns a set with the names of the files received from other applications | 249 // Returns a set with the names of the files received from other applications |
| 265 // that are still referenced by an open or recently closed tab. | 250 // that are still referenced by an open or recently closed tab. |
| 266 - (NSSet*)currentlyReferencedExternalFiles; | 251 - (NSSet*)currentlyReferencedExternalFiles; |
| 267 | 252 |
| 268 // Called when the browser state provided to this instance is being destroyed. | 253 // Called when the browser state provided to this instance is being destroyed. |
| 269 // At this point the tab model will no longer ever be active, and will likely be | 254 // At this point the tab model will no longer ever be active, and will likely be |
| 270 // deallocated soon. | 255 // deallocated soon. |
| 271 - (void)browserStateDestroyed; | 256 - (void)browserStateDestroyed; |
| 272 // Called by the Tab to inform its parent that it has been closed. | |
| 273 - (void)didCloseTab:(Tab*)closedTab; | |
| 274 // Called by |tab| to inform the model that a navigation has taken place. | 257 // Called by |tab| to inform the model that a navigation has taken place. |
| 275 // TODO(crbug.com/661983): once more of the navigation state has moved into WC, | 258 // TODO(crbug.com/661983): once more of the navigation state has moved into WC, |
| 276 // replace this with WebStateObserver. | 259 // replace this with WebStateObserver. |
| 277 - (void)navigationCommittedInTab:(Tab*)tab | 260 - (void)navigationCommittedInTab:(Tab*)tab |
| 278 previousItem:(web::NavigationItem*)previousItem; | 261 previousItem:(web::NavigationItem*)previousItem; |
| 279 | 262 |
| 280 @end | 263 @end |
| 281 | 264 |
| 282 #endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_ | 265 #endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_ |
| OLD | NEW |