| 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_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ |
| 6 #define IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #import <UIKit/UIKit.h> | 9 #import <UIKit/UIKit.h> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/ios/block_types.h" | 12 #include "base/ios/block_types.h" |
| 13 #include "ios/web/public/favicon_url.h" | 13 #include "ios/web/public/favicon_url.h" |
| 14 #import "ios/web/public/navigation_manager.h" |
| 14 #include "ios/web/public/ssl_status.h" | 15 #include "ios/web/public/ssl_status.h" |
| 15 #import "ios/web/public/web_state/ui/crw_native_content.h" | 16 #import "ios/web/public/web_state/ui/crw_native_content.h" |
| 16 #include "ios/web/public/web_state/web_state.h" | 17 #include "ios/web/public/web_state/web_state.h" |
| 17 #include "ui/base/page_transition_types.h" | 18 #include "ui/base/page_transition_types.h" |
| 18 | 19 |
| 19 class GURL; | 20 class GURL; |
| 20 @class CRWSessionEntry; | 21 @class CRWSessionEntry; |
| 21 @class CRWWebController; | 22 @class CRWWebController; |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| 24 class HttpResponseHeaders; | 25 class HttpResponseHeaders; |
| 25 class SSLInfo; | 26 class SSLInfo; |
| 26 class X509Certificate; | 27 class X509Certificate; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace web { | 30 namespace web { |
| 30 class BlockedPopupInfo; | 31 class BlockedPopupInfo; |
| 31 struct Referrer; | 32 struct Referrer; |
| 32 struct WebLoadParams; | |
| 33 } | 33 } |
| 34 | 34 |
| 35 // Callback for -presentSSLError:forSSLStatus:onUrl:recoverable:callback: | 35 // Callback for -presentSSLError:forSSLStatus:onUrl:recoverable:callback: |
| 36 typedef void (^SSLErrorCallback)(BOOL); | 36 typedef void (^SSLErrorCallback)(BOOL); |
| 37 | 37 |
| 38 // Methods implemented by the delegate of the CRWWebController. | 38 // Methods implemented by the delegate of the CRWWebController. |
| 39 @protocol CRWWebDelegate<NSObject> | 39 @protocol CRWWebDelegate<NSObject> |
| 40 | 40 |
| 41 // Called when the page wants to open a new window by DOM (e.g. with | 41 // Called when the page wants to open a new window by DOM (e.g. with |
| 42 // |window.open| JavaScript call or by clicking a link with |_blank| target) or | 42 // |window.open| JavaScript call or by clicking a link with |_blank| target) or |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // possible. They only exist because the Tab and CRWWebController logic was | 137 // possible. They only exist because the Tab and CRWWebController logic was |
| 138 // very intertwined. We should streamline the logic to jump between classes | 138 // very intertwined. We should streamline the logic to jump between classes |
| 139 // less, then remove any delegate method that becomes unneccessary as a result. | 139 // less, then remove any delegate method that becomes unneccessary as a result. |
| 140 | 140 |
| 141 // Called when the page is reloaded. | 141 // Called when the page is reloaded. |
| 142 - (void)webWillReload; | 142 - (void)webWillReload; |
| 143 // Called when a page is loaded using loadWithParams. In | 143 // Called when a page is loaded using loadWithParams. In |
| 144 // |webWillInitiateLoadWithParams|, the |params| argument is non-const so that | 144 // |webWillInitiateLoadWithParams|, the |params| argument is non-const so that |
| 145 // the delegate can make changes if necessary. | 145 // the delegate can make changes if necessary. |
| 146 // TODO(rohitrao): This is not a great API. Clean it up. | 146 // TODO(rohitrao): This is not a great API. Clean it up. |
| 147 - (void)webWillInitiateLoadWithParams:(web::WebLoadParams&)params; | 147 - (void)webWillInitiateLoadWithParams: |
| 148 - (void)webDidUpdateSessionForLoadWithParams:(const web::WebLoadParams&)params | 148 (web::NavigationManager::WebLoadParams&)params; |
| 149 - (void)webDidUpdateSessionForLoadWithParams: |
| 150 (const web::NavigationManager::WebLoadParams&)params |
| 149 wasInitialNavigation:(BOOL)initialNavigation; | 151 wasInitialNavigation:(BOOL)initialNavigation; |
| 150 // Called from finishHistoryNavigationFromEntry. | 152 // Called from finishHistoryNavigationFromEntry. |
| 151 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; | 153 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; |
| 152 // --------------------------------------------------------------------- | 154 // --------------------------------------------------------------------- |
| 153 | 155 |
| 154 @optional | 156 @optional |
| 155 | 157 |
| 156 // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. | 158 // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. |
| 157 // CRWWebDelegate can intercept the request by returning NO and processing URL | 159 // CRWWebDelegate can intercept the request by returning NO and processing URL |
| 158 // in own way. | 160 // in own way. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // Called when a PassKit file is downloaded. |data| should be the data from a | 230 // Called when a PassKit file is downloaded. |data| should be the data from a |
| 229 // PassKit file, but this is not guaranteed, and the delegate is responsible for | 231 // PassKit file, but this is not guaranteed, and the delegate is responsible for |
| 230 // error handling non PassKit data using -[PKPass initWithData:error:]. If the | 232 // error handling non PassKit data using -[PKPass initWithData:error:]. If the |
| 231 // download does not successfully complete, |data| will be nil. | 233 // download does not successfully complete, |data| will be nil. |
| 232 - (void)webController:(CRWWebController*)webController | 234 - (void)webController:(CRWWebController*)webController |
| 233 didLoadPassKitObject:(NSData*)data; | 235 didLoadPassKitObject:(NSData*)data; |
| 234 | 236 |
| 235 @end | 237 @end |
| 236 | 238 |
| 237 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ | 239 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ |
| OLD | NEW |