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> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class HttpResponseHeaders; | 25 class HttpResponseHeaders; |
26 class SSLInfo; | 26 class SSLInfo; |
27 class X509Certificate; | 27 class X509Certificate; |
28 } | 28 } |
29 | 29 |
30 namespace web { | 30 namespace web { |
31 class BlockedPopupInfo; | 31 class BlockedPopupInfo; |
32 struct Referrer; | 32 struct Referrer; |
33 } | 33 } |
34 | 34 |
35 // Callback for -presentSSLError:forSSLStatus:onUrl:recoverable:callback: | |
36 typedef void (^SSLErrorCallback)(BOOL); | |
37 | |
38 // Methods implemented by the delegate of the CRWWebController. | 35 // Methods implemented by the delegate of the CRWWebController. |
39 @protocol CRWWebDelegate<NSObject> | 36 @protocol CRWWebDelegate<NSObject> |
40 | 37 |
41 // Called when the page wants to open a new window by DOM (e.g. with | 38 // 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 | 39 // |window.open| JavaScript call or by clicking a link with |_blank| target) or |
43 // wants to open a window with a new tab. |inBackground| allows a page to force | 40 // wants to open a window with a new tab. |inBackground| allows a page to force |
44 // a new window to open in the background. CRWSessionController's openedByDOM | 41 // a new window to open in the background. CRWSessionController's openedByDOM |
45 // property of the returned CRWWebController must be YES. | 42 // property of the returned CRWWebController must be YES. |
46 - (CRWWebController*)webPageOrderedOpen:(const GURL&)url | 43 - (CRWWebController*)webPageOrderedOpen:(const GURL&)url |
47 referrer:(const web::Referrer&)referrer | 44 referrer:(const web::Referrer&)referrer |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 (web::NavigationManager::WebLoadParams&)params; | 133 (web::NavigationManager::WebLoadParams&)params; |
137 - (void)webDidUpdateSessionForLoadWithParams: | 134 - (void)webDidUpdateSessionForLoadWithParams: |
138 (const web::NavigationManager::WebLoadParams&)params | 135 (const web::NavigationManager::WebLoadParams&)params |
139 wasInitialNavigation:(BOOL)initialNavigation; | 136 wasInitialNavigation:(BOOL)initialNavigation; |
140 // Called from finishHistoryNavigationFromEntry. | 137 // Called from finishHistoryNavigationFromEntry. |
141 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; | 138 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; |
142 // --------------------------------------------------------------------- | 139 // --------------------------------------------------------------------- |
143 | 140 |
144 @optional | 141 @optional |
145 | 142 |
146 // This method is called when a network request has an issue with the SSL | |
147 // connection to present it to the user. The user will decide if the request | |
148 // should continue or not and the callback should be invoked to let the backend | |
149 // know. | |
150 // The callback is safe to call until CRWWebController is closed. | |
151 - (void)presentSSLError:(const net::SSLInfo&)info | |
152 forSSLStatus:(const web::SSLStatus&)status | |
153 recoverable:(BOOL)recoverable | |
154 callback:(SSLErrorCallback)shouldContinue; | |
155 | |
156 // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. | 143 // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. |
157 // CRWWebDelegate can intercept the request by returning NO and processing URL | 144 // CRWWebDelegate can intercept the request by returning NO and processing URL |
158 // in own way. | 145 // in own way. |
159 - (BOOL)webController:(CRWWebController*)webController | 146 - (BOOL)webController:(CRWWebController*)webController |
160 shouldOpenURL:(const GURL&)url | 147 shouldOpenURL:(const GURL&)url |
161 mainDocumentURL:(const GURL&)mainDocumentURL | 148 mainDocumentURL:(const GURL&)mainDocumentURL |
162 linkClicked:(BOOL)linkClicked; | 149 linkClicked:(BOOL)linkClicked; |
163 | 150 |
164 // Called to ask if external URL should be opened. External URL is one that | 151 // Called to ask if external URL should be opened. External URL is one that |
165 // cannot be presented by CRWWebController. | 152 // cannot be presented by CRWWebController. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // Called when a PassKit file is downloaded. |data| should be the data from a | 211 // Called when a PassKit file is downloaded. |data| should be the data from a |
225 // PassKit file, but this is not guaranteed, and the delegate is responsible for | 212 // PassKit file, but this is not guaranteed, and the delegate is responsible for |
226 // error handling non PassKit data using -[PKPass initWithData:error:]. If the | 213 // error handling non PassKit data using -[PKPass initWithData:error:]. If the |
227 // download does not successfully complete, |data| will be nil. | 214 // download does not successfully complete, |data| will be nil. |
228 - (void)webController:(CRWWebController*)webController | 215 - (void)webController:(CRWWebController*)webController |
229 didLoadPassKitObject:(NSData*)data; | 216 didLoadPassKitObject:(NSData*)data; |
230 | 217 |
231 @end | 218 @end |
232 | 219 |
233 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ | 220 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ |
OLD | NEW |