| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #import "components/signin/ios/browser/manage_accounts_delegate.h" | 13 #import "components/signin/ios/browser/manage_accounts_delegate.h" |
| 14 #include "ios/net/request_tracker.h" | 14 #include "ios/net/request_tracker.h" |
| 15 #import "ios/shared/chrome/browser/tabs/web_state_handle.h" |
| 15 #import "ios/web/public/web_state/ui/crw_web_delegate.h" | 16 #import "ios/web/public/web_state/ui/crw_web_delegate.h" |
| 16 #include "ui/base/page_transition_types.h" | 17 #include "ui/base/page_transition_types.h" |
| 17 | 18 |
| 18 @class AutofillController; | 19 @class AutofillController; |
| 19 @class AutoReloadBridge; | 20 @class AutoReloadBridge; |
| 20 @class CastController; | 21 @class CastController; |
| 21 @protocol CRWNativeContentProvider; | 22 @protocol CRWNativeContentProvider; |
| 22 @class CRWSessionEntry; | 23 @class CRWSessionEntry; |
| 23 @class CRWWebController; | 24 @class CRWWebController; |
| 24 @class ExternalAppLauncher; | 25 @class ExternalAppLauncher; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 57 |
| 57 namespace sessions { | 58 namespace sessions { |
| 58 class SerializedNavigationEntry; | 59 class SerializedNavigationEntry; |
| 59 struct SessionTab; | 60 struct SessionTab; |
| 60 } | 61 } |
| 61 | 62 |
| 62 namespace web { | 63 namespace web { |
| 63 class NavigationManagerImpl; | 64 class NavigationManagerImpl; |
| 64 struct Referrer; | 65 struct Referrer; |
| 65 class WebState; | 66 class WebState; |
| 66 class WebStateImpl; | |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Notification sent by a Tab when it starts to load a new URL. This | 69 // Notification sent by a Tab when it starts to load a new URL. This |
| 70 // notification must only be used for crash reporting as it is also sent for | 70 // notification must only be used for crash reporting as it is also sent for |
| 71 // pre-rendered tabs. | 71 // pre-rendered tabs. |
| 72 extern NSString* const kTabUrlStartedLoadingNotificationForCrashReporting; | 72 extern NSString* const kTabUrlStartedLoadingNotificationForCrashReporting; |
| 73 | 73 |
| 74 // Notification sent by a Tab when it is likely about to start loading a new | 74 // Notification sent by a Tab when it is likely about to start loading a new |
| 75 // URL. This notification must only be used for crash reporting as it is also | 75 // URL. This notification must only be used for crash reporting as it is also |
| 76 // sent for pre-rendered tabs. | 76 // sent for pre-rendered tabs. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 91 | 91 |
| 92 // The header name and value for the data reduction proxy to request an image to | 92 // The header name and value for the data reduction proxy to request an image to |
| 93 // be reloaded without optimizations. | 93 // be reloaded without optimizations. |
| 94 extern NSString* const kProxyPassthroughHeaderName; | 94 extern NSString* const kProxyPassthroughHeaderName; |
| 95 extern NSString* const kProxyPassthroughHeaderValue; | 95 extern NSString* const kProxyPassthroughHeaderValue; |
| 96 | 96 |
| 97 // Information related to a single tab. The CRWWebController is similar to | 97 // Information related to a single tab. The CRWWebController is similar to |
| 98 // desktop Chrome's TabContents in that it encapsulates rendering. Acts as the | 98 // desktop Chrome's TabContents in that it encapsulates rendering. Acts as the |
| 99 // delegate for the CRWWebController in order to process info about pages having | 99 // delegate for the CRWWebController in order to process info about pages having |
| 100 // loaded. | 100 // loaded. |
| 101 @interface Tab : NSObject<CRWWebDelegate, ManageAccountsDelegate> | 101 @interface Tab |
| 102 : NSObject<CRWWebDelegate, ManageAccountsDelegate, WebStateHandle> |
| 102 | 103 |
| 103 // Browser state associated with this Tab. | 104 // Browser state associated with this Tab. |
| 104 @property(nonatomic, readonly) ios::ChromeBrowserState* browserState; | 105 @property(nonatomic, readonly) ios::ChromeBrowserState* browserState; |
| 105 | 106 |
| 106 // TODO(crbug.com/546208): Eliminate this; replace calls with either visible URL | 107 // TODO(crbug.com/546208): Eliminate this; replace calls with either visible URL |
| 107 // or last committed URL, depending on the specific use case. | 108 // or last committed URL, depending on the specific use case. |
| 108 // Do not add new calls to this method. | 109 // Do not add new calls to this method. |
| 109 @property(nonatomic, readonly) const GURL& url; | 110 @property(nonatomic, readonly) const GURL& url; |
| 110 | 111 |
| 111 // The Passkit Dialog provider used to show the UI to download a passkit object. | 112 // The Passkit Dialog provider used to show the UI to download a passkit object. |
| 112 @property(nonatomic, assign) id<PassKitDialogProvider> passKitDialogProvider; | 113 @property(nonatomic, assign) id<PassKitDialogProvider> passKitDialogProvider; |
| 113 | 114 |
| 114 // The current title of the tab. | 115 // The current title of the tab. |
| 115 @property(nonatomic, readonly) NSString* title; | 116 @property(nonatomic, readonly) NSString* title; |
| 116 | 117 |
| 117 // Original page title or nil if the page did not provide one. | 118 // Original page title or nil if the page did not provide one. |
| 118 @property(nonatomic, readonly) NSString* originalTitle; | 119 @property(nonatomic, readonly) NSString* originalTitle; |
| 119 | 120 |
| 120 @property(nonatomic, readonly) NSString* urlDisplayString; | 121 @property(nonatomic, readonly) NSString* urlDisplayString; |
| 121 @property(nonatomic, readonly) NSString* windowName; | 122 @property(nonatomic, readonly) NSString* windowName; |
| 122 | 123 |
| 123 // ID associated with this tab, from the SessionManager. | 124 // ID associated with this tab, from the SessionManager. |
| 124 @property(nonatomic, readonly) NSString* tabId; | 125 @property(nonatomic, readonly) NSString* tabId; |
| 125 | 126 |
| 126 // |YES| if snapshot overlay should load from the grey image cache. | 127 // |YES| if snapshot overlay should load from the grey image cache. |
| 127 @property(nonatomic, assign) BOOL useGreyImageCache; | 128 @property(nonatomic, assign) BOOL useGreyImageCache; |
| 128 | 129 |
| 129 // webStateImpl is deprecated: use webState instead. | |
| 130 @property(nonatomic, readonly) web::WebStateImpl* webStateImpl; | |
| 131 @property(nonatomic, readonly) web::WebState* webState; | |
| 132 | |
| 133 @property(nonatomic, readonly) CRWWebController* webController; | 130 @property(nonatomic, readonly) CRWWebController* webController; |
| 134 @property(nonatomic, readonly) PasswordController* passwordController; | 131 @property(nonatomic, readonly) PasswordController* passwordController; |
| 135 @property(nonatomic, readonly) BOOL canGoBack; | 132 @property(nonatomic, readonly) BOOL canGoBack; |
| 136 @property(nonatomic, readonly) BOOL canGoForward; | 133 @property(nonatomic, readonly) BOOL canGoForward; |
| 137 @property(nonatomic, assign) id<TabDelegate> delegate; | 134 @property(nonatomic, assign) id<TabDelegate> delegate; |
| 138 @property(nonatomic, assign) id<TabHeadersDelegate> tabHeadersDelegate; | 135 @property(nonatomic, assign) id<TabHeadersDelegate> tabHeadersDelegate; |
| 139 @property(nonatomic, assign) id<TabSnapshottingDelegate> | 136 @property(nonatomic, assign) id<TabSnapshottingDelegate> |
| 140 tabSnapshottingDelegate; | 137 tabSnapshottingDelegate; |
| 141 @property(nonatomic, readonly) BOOL useDesktopUserAgent; | 138 @property(nonatomic, readonly) BOOL useDesktopUserAgent; |
| 142 @property(nonatomic, assign) id<StoreKitLauncher> storeKitLauncher; | 139 @property(nonatomic, assign) id<StoreKitLauncher> storeKitLauncher; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 341 |
| 345 // Called when this tab is hidden. | 342 // Called when this tab is hidden. |
| 346 - (void)wasHidden; | 343 - (void)wasHidden; |
| 347 | 344 |
| 348 // Evaluates U2F result. | 345 // Evaluates U2F result. |
| 349 - (void)evaluateU2FResultFromURL:(const GURL&)url; | 346 - (void)evaluateU2FResultFromURL:(const GURL&)url; |
| 350 | 347 |
| 351 @end | 348 @end |
| 352 | 349 |
| 353 #endif // IOS_CHROME_BROWSER_TABS_TAB_H_ | 350 #endif // IOS_CHROME_BROWSER_TABS_TAB_H_ |
| OLD | NEW |