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_H_ | 5 #ifndef IOS_CHROME_BROWSER_TABS_TAB_H_ |
6 #define IOS_CHROME_BROWSER_TABS_TAB_H_ | 6 #define IOS_CHROME_BROWSER_TABS_TAB_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 // The Passkit Dialog provider used to show the UI to download a passkit object. | 107 // The Passkit Dialog provider used to show the UI to download a passkit object. |
108 @property(nonatomic, assign) id<PassKitDialogProvider> passKitDialogProvider; | 108 @property(nonatomic, assign) id<PassKitDialogProvider> passKitDialogProvider; |
109 | 109 |
110 // The current title of the tab. | 110 // The current title of the tab. |
111 @property(nonatomic, readonly) NSString* title; | 111 @property(nonatomic, readonly) NSString* title; |
112 | 112 |
113 // Original page title or nil if the page did not provide one. | 113 // Original page title or nil if the page did not provide one. |
114 @property(nonatomic, readonly) NSString* originalTitle; | 114 @property(nonatomic, readonly) NSString* originalTitle; |
115 | 115 |
116 @property(nonatomic, readonly) NSString* urlDisplayString; | 116 @property(nonatomic, readonly) NSString* urlDisplayString; |
117 @property(nonatomic, readonly) NSString* windowName; | |
118 | 117 |
119 // ID associated with this tab. | 118 // ID associated with this tab. |
120 @property(nonatomic, readonly) NSString* tabId; | 119 @property(nonatomic, readonly) NSString* tabId; |
121 | 120 |
122 // ID of the opener of this tab. | 121 // ID of the opener of this tab. |
123 @property(nonatomic, readonly) NSString* openerID; | 122 @property(nonatomic, readonly) NSString* openerID; |
124 | 123 |
125 // NavigationIndex of the opener of this tab. | 124 // NavigationIndex of the opener of this tab. |
126 @property(nonatomic, readonly) NSInteger openerNavigationIndex; | 125 @property(nonatomic, readonly) NSInteger openerNavigationIndex; |
127 | 126 |
(...skipping 30 matching lines...) Expand all Loading... | |
158 | 157 |
159 // TODO(crbug.com/661663): Should this property abstract away the concept of | 158 // TODO(crbug.com/661663): Should this property abstract away the concept of |
160 // prerendering? Maybe this can move to the TabDelegate interface. | 159 // prerendering? Maybe this can move to the TabDelegate interface. |
161 @property(nonatomic, assign) BOOL isPrerenderTab; | 160 @property(nonatomic, assign) BOOL isPrerenderTab; |
162 @property(nonatomic, assign) BOOL isLinkLoadingPrerenderTab; | 161 @property(nonatomic, assign) BOOL isLinkLoadingPrerenderTab; |
163 @property(nonatomic, assign) BOOL isVoiceSearchResultsTab; | 162 @property(nonatomic, assign) BOOL isVoiceSearchResultsTab; |
164 | 163 |
165 // Creates a new tab with the given state. |opener| is nil unless another tab | 164 // Creates a new tab with the given state. |opener| is nil unless another tab |
166 // is conceptually the parent of this tab. |openedByDOM| is YES if the page was | 165 // is conceptually the parent of this tab. |openedByDOM| is YES if the page was |
167 // opened by DOM. |model| and |browserState| must not be nil. | 166 // opened by DOM. |model| and |browserState| must not be nil. |
168 - (instancetype)initWithWindowName:(NSString*)windowName | 167 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState |
169 opener:(Tab*)opener | 168 opener:(Tab*)opener |
170 openedByDOM:(BOOL)openedByDOM | 169 openedByDOM:(BOOL)openedByDOM |
171 model:(TabModel*)parentModel | 170 model:(TabModel*)parentModel; |
172 browserState:(ios::ChromeBrowserState*)browserState; | |
173 | 171 |
174 // Create a new tab with given web state and tab model. All must be non-nil. | 172 // Create a new tab with given web state and tab model. All must be non-nil. |
175 - (instancetype)initWithWebState:(std::unique_ptr<web::WebState>)webState | 173 - (instancetype)initWithWebState:(std::unique_ptr<web::WebState>)webState |
176 model:(TabModel*)parentModel; | 174 model:(TabModel*)parentModel; |
177 | 175 |
178 // Create a new tab with given web state and tab model, optionally attaching | 176 // Create a new tab with given web state and tab model, optionally attaching |
179 // the tab helpers (controlled by |attachTabHelpers|). All must be non-nil. | 177 // the tab helpers (controlled by |attachTabHelpers|). All must be non-nil. |
180 - (instancetype)initWithWebState:(std::unique_ptr<web::WebState>)webState | 178 - (instancetype)initWithWebState:(std::unique_ptr<web::WebState>)webState |
181 model:(TabModel*)parentModel | 179 model:(TabModel*)parentModel |
182 attachTabHelpers:(BOOL)attachTabHelpers | 180 attachTabHelpers:(BOOL)attachTabHelpers |
183 NS_DESIGNATED_INITIALIZER; | 181 NS_DESIGNATED_INITIALIZER; |
184 | 182 |
185 - (instancetype)init NS_UNAVAILABLE; | 183 - (instancetype)init NS_UNAVAILABLE; |
186 | 184 |
187 // Creates a new Tab instance loading |url| with |transition|, configured | 185 // Creates a new Tab instance loading |url| with |transition|, configured |
188 // with no TabModel. |opener| may be nil, and behaves exactly as for | 186 // with no TabModel. |opener| may be nil, and behaves exactly as for |
189 // -initWithWindowName:opener:model:browserState:. | 187 // -initWithBrowserState:opener:model. |
Eugene But (OOO till 7-30)
2017/02/28 16:04:09
initWithBrowserState:opener:openedByDOM:model: ?
sdefresne
2017/02/28 17:41:07
Done.
| |
190 // |configuration| is a block that will be run before |url| starts loading, | 188 // |configuration| is a block that will be run before |url| starts loading, |
191 // and is the correct place to set properties and delegates on the tab. | 189 // and is the correct place to set properties and delegates on the tab. |
192 // Calling code must take ownership of the tab -- this is particularly important | 190 // Calling code must take ownership of the tab -- this is particularly important |
193 // with Tab instances, because they will fail a DCHECK if they are deallocated | 191 // with Tab instances, because they will fail a DCHECK if they are deallocated |
194 // when falling out of scope without -close being called. | 192 // when falling out of scope without -close being called. |
195 + (Tab*)newPreloadingTabWithBrowserState:(ios::ChromeBrowserState*)browserState | 193 + (Tab*)newPreloadingTabWithBrowserState:(ios::ChromeBrowserState*)browserState |
196 url:(const GURL&)url | 194 url:(const GURL&)url |
197 referrer:(const web::Referrer&)referrer | 195 referrer:(const web::Referrer&)referrer |
198 transition:(ui::PageTransition)transition | 196 transition:(ui::PageTransition)transition |
199 provider:(id<CRWNativeContentProvider>)provider | 197 provider:(id<CRWNativeContentProvider>)provider |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 | 343 |
346 // Called when this tab is hidden. | 344 // Called when this tab is hidden. |
347 - (void)wasHidden; | 345 - (void)wasHidden; |
348 | 346 |
349 // Evaluates U2F result. | 347 // Evaluates U2F result. |
350 - (void)evaluateU2FResultFromURL:(const GURL&)url; | 348 - (void)evaluateU2FResultFromURL:(const GURL&)url; |
351 | 349 |
352 @end | 350 @end |
353 | 351 |
354 #endif // IOS_CHROME_BROWSER_TABS_TAB_H_ | 352 #endif // IOS_CHROME_BROWSER_TABS_TAB_H_ |
OLD | NEW |