| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 - (BOOL)webController:(CRWWebController*)webController | 63 - (BOOL)webController:(CRWWebController*)webController |
| 64 shouldOpenURL:(const GURL&)url | 64 shouldOpenURL:(const GURL&)url |
| 65 mainDocumentURL:(const GURL&)mainDocumentURL | 65 mainDocumentURL:(const GURL&)mainDocumentURL |
| 66 linkClicked:(BOOL)linkClicked; | 66 linkClicked:(BOOL)linkClicked; |
| 67 | 67 |
| 68 // Called to ask if external URL should be opened. External URL is one that | 68 // Called to ask if external URL should be opened. External URL is one that |
| 69 // cannot be presented by CRWWebController. | 69 // cannot be presented by CRWWebController. |
| 70 - (BOOL)webController:(CRWWebController*)webController | 70 - (BOOL)webController:(CRWWebController*)webController |
| 71 shouldOpenExternalURL:(const GURL&)URL; | 71 shouldOpenExternalURL:(const GURL&)URL; |
| 72 | 72 |
| 73 // Called when |URL| is deemed suitable to be opened in a matching native app. | |
| 74 // Needs to return whether |URL| was opened in a matching native app. | |
| 75 // Also triggering user action |linkClicked| is passed to use it when needed. | |
| 76 // The return value indicates if the native app was launched, not if a native | |
| 77 // app was found. | |
| 78 - (BOOL)urlTriggersNativeAppLaunch:(const GURL&)URL | |
| 79 sourceURL:(const GURL&)sourceURL | |
| 80 linkClicked:(BOOL)linkClicked; | |
| 81 | |
| 82 // Called to ask the delegate for a controller to display the given url, | 73 // Called to ask the delegate for a controller to display the given url, |
| 83 // which contained content that the UIWebView couldn't display. Returns | 74 // which contained content that the UIWebView couldn't display. Returns |
| 84 // the native controller to display if the delegate can handle the url, | 75 // the native controller to display if the delegate can handle the url, |
| 85 // or nil otherwise. | 76 // or nil otherwise. |
| 86 - (id<CRWNativeContent>)controllerForUnhandledContentAtURL:(const GURL&)url; | 77 - (id<CRWNativeContent>)controllerForUnhandledContentAtURL:(const GURL&)url; |
| 87 | 78 |
| 88 // Called to retrieve the height of any header that is overlaying on top of the | 79 // Called to retrieve the height of any header that is overlaying on top of the |
| 89 // web view. This can be used to implement, for e.g. a toolbar that changes | 80 // web view. This can be used to implement, for e.g. a toolbar that changes |
| 90 // height dynamically. Returning a non-zero height affects the visible frame | 81 // height dynamically. Returning a non-zero height affects the visible frame |
| 91 // shown by the CRWWebController. 0.0 is assumed if not implemented. | 82 // shown by the CRWWebController. 0.0 is assumed if not implemented. |
| 92 - (CGFloat)headerHeightForWebController:(CRWWebController*)webController; | 83 - (CGFloat)headerHeightForWebController:(CRWWebController*)webController; |
| 93 | 84 |
| 94 // Called when a PassKit file is downloaded. |data| should be the data from a | 85 // Called when a PassKit file is downloaded. |data| should be the data from a |
| 95 // PassKit file, but this is not guaranteed, and the delegate is responsible for | 86 // PassKit file, but this is not guaranteed, and the delegate is responsible for |
| 96 // error handling non PassKit data using -[PKPass initWithData:error:]. If the | 87 // error handling non PassKit data using -[PKPass initWithData:error:]. If the |
| 97 // download does not successfully complete, |data| will be nil. | 88 // download does not successfully complete, |data| will be nil. |
| 98 - (void)webController:(CRWWebController*)webController | 89 - (void)webController:(CRWWebController*)webController |
| 99 didLoadPassKitObject:(NSData*)data; | 90 didLoadPassKitObject:(NSData*)data; |
| 100 | 91 |
| 101 @end | 92 @end |
| 102 | 93 |
| 103 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ | 94 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ |
| OLD | NEW |