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

Side by Side Diff: ios/chrome/browser/tabs/tab_model.h

Issue 2769193002: [ios] Expose TabModel underlying WebStateList. (Closed)
Patch Set: Rebase on origin/master. Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/tabs/tab_model.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include <memory> 11 #include <memory>
12 12
13 #import "ios/web/public/navigation_manager.h" 13 #import "ios/web/public/navigation_manager.h"
14 #include "ui/base/page_transition_types.h" 14 #include "ui/base/page_transition_types.h"
15 15
16 class GURL; 16 class GURL;
17 class SessionID; 17 class SessionID;
18 @class SessionServiceIOS; 18 @class SessionServiceIOS;
19 @class SessionWindowIOS; 19 @class SessionWindowIOS;
20 @class Tab; 20 @class Tab;
21 @protocol TabModelObserver; 21 @protocol TabModelObserver;
22 class TabModelSyncedWindowDelegate; 22 class TabModelSyncedWindowDelegate;
23 class TabUsageRecorder; 23 class TabUsageRecorder;
24 class WebStateList;
24 25
25 namespace ios { 26 namespace ios {
26 class ChromeBrowserState; 27 class ChromeBrowserState;
27 } 28 }
28 29
29 namespace web { 30 namespace web {
30 struct Referrer; 31 struct Referrer;
31 class WebState; 32 class WebState;
32 } 33 }
33 34
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 107
107 // YES if this tab set is off the record. 108 // YES if this tab set is off the record.
108 @property(nonatomic, readonly, getter=isOffTheRecord) BOOL offTheRecord; 109 @property(nonatomic, readonly, getter=isOffTheRecord) BOOL offTheRecord;
109 110
110 // NO if the model has at least one tab. 111 // NO if the model has at least one tab.
111 @property(nonatomic, readonly, getter=isEmpty) BOOL empty; 112 @property(nonatomic, readonly, getter=isEmpty) BOOL empty;
112 113
113 // Determines the number of tabs in the model. 114 // Determines the number of tabs in the model.
114 @property(nonatomic, readonly) NSUInteger count; 115 @property(nonatomic, readonly) NSUInteger count;
115 116
117 // The WebStateList owned by the TabModel.
118 @property(nonatomic, readonly) WebStateList* webStateList;
119
116 // Initializes tabs from a restored session. |-setCurrentTab| needs to be called 120 // Initializes tabs from a restored session. |-setCurrentTab| needs to be called
117 // in order to display the views associated with the tabs. Waits until the views 121 // in order to display the views associated with the tabs. Waits until the views
118 // are ready. |browserState| cannot be nil. |service| cannot be nil; this class 122 // are ready. |browserState| cannot be nil. |service| cannot be nil; this class
119 // creates intermediate SessionWindowIOS objects which must be consumed by a 123 // creates intermediate SessionWindowIOS objects which must be consumed by a
120 // session service before they are deallocated. |window| can be nil to create 124 // session service before they are deallocated. |window| can be nil to create
121 // an empty TabModel. In that case no notification will be sent during object 125 // an empty TabModel. In that case no notification will be sent during object
122 // creation. 126 // creation.
123 - (instancetype)initWithSessionWindow:(SessionWindowIOS*)window 127 - (instancetype)initWithSessionWindow:(SessionWindowIOS*)window
124 sessionService:(SessionServiceIOS*)service 128 sessionService:(SessionServiceIOS*)service
125 browserState:(ios::ChromeBrowserState*)browserState 129 browserState:(ios::ChromeBrowserState*)browserState
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 - (void)didCloseTab:(Tab*)closedTab; 273 - (void)didCloseTab:(Tab*)closedTab;
270 // Called by |tab| to inform the model that a navigation has taken place. 274 // Called by |tab| to inform the model that a navigation has taken place.
271 // TODO(crbug.com/661983): once more of the navigation state has moved into WC, 275 // TODO(crbug.com/661983): once more of the navigation state has moved into WC,
272 // replace this with WebStateObserver. 276 // replace this with WebStateObserver.
273 - (void)navigationCommittedInTab:(Tab*)tab 277 - (void)navigationCommittedInTab:(Tab*)tab
274 previousItem:(web::NavigationItem*)previousItem; 278 previousItem:(web::NavigationItem*)previousItem;
275 279
276 @end 280 @end
277 281
278 #endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_ 282 #endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/tabs/tab_model.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698