| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // updating the navigation manager's pending entry. | 60 // updating the navigation manager's pending entry. |
| 61 // Phase will be LOAD_REQUESTED. | 61 // Phase will be LOAD_REQUESTED. |
| 62 - (void)webWillAddPendingURL:(const GURL&)url | 62 - (void)webWillAddPendingURL:(const GURL&)url |
| 63 transition:(ui::PageTransition)transition; | 63 transition:(ui::PageTransition)transition; |
| 64 // Called when webWillStartLoadingURL was called, but something went wrong, and | 64 // Called when webWillStartLoadingURL was called, but something went wrong, and |
| 65 // webDidStartLoadingURL will now never be called. | 65 // webDidStartLoadingURL will now never be called. |
| 66 - (void)webCancelStartLoadingRequest; | 66 - (void)webCancelStartLoadingRequest; |
| 67 // Called when the page URL has changed. Phase will be PAGE_LOADING. Can be | 67 // Called when the page URL has changed. Phase will be PAGE_LOADING. Can be |
| 68 // followed by webDidFinishWithURL or webWillStartLoadingURL. | 68 // followed by webDidFinishWithURL or webWillStartLoadingURL. |
| 69 // |updateHistory| is YES if the URL should be added to the history DB. | 69 // |updateHistory| is YES if the URL should be added to the history DB. |
| 70 // TODO(stuartmorgan): Remove or rename the history param; the history DB | 70 // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|. |
| 71 // isn't a web concept, so this shoud be expressed differently. | |
| 72 - (void)webDidStartLoadingURL:(const GURL&)url | 71 - (void)webDidStartLoadingURL:(const GURL&)url |
| 73 shouldUpdateHistory:(BOOL)updateHistory; | 72 shouldUpdateHistory:(BOOL)updateHistory; |
| 74 // Called when the page load was cancelled by page activity (before a success / | 73 // Called when the page load was cancelled by page activity (before a success / |
| 75 // failure state is known). Phase will be PAGE_LOADED. | 74 // failure state is known). Phase will be PAGE_LOADED. |
| 76 - (void)webLoadCancelled:(const GURL&)url; | 75 - (void)webLoadCancelled:(const GURL&)url; |
| 77 // Called when a page updates its history stack using pushState or replaceState. | 76 // Called when a page updates its history stack using pushState or replaceState. |
| 78 // TODO(stuartmorgan): Generalize this to cover any change of URL without page | 77 // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|. |
| 79 // document change. | |
| 80 - (void)webDidUpdateHistoryStateWithPageURL:(const GURL&)pageUrl; | 78 - (void)webDidUpdateHistoryStateWithPageURL:(const GURL&)pageUrl; |
| 81 // Called when a placeholder image should be displayed instead of the WebView. | 79 // Called when a placeholder image should be displayed instead of the WebView. |
| 82 - (void)webController:(CRWWebController*)webController | 80 - (void)webController:(CRWWebController*)webController |
| 83 retrievePlaceholderOverlayImage:(void (^)(UIImage*))block; | 81 retrievePlaceholderOverlayImage:(void (^)(UIImage*))block; |
| 84 | 82 |
| 85 // --------------------------------------------------------------------- | 83 // --------------------------------------------------------------------- |
| 86 // TODO(rohitrao): Eliminate as many of the following delegate methods as | 84 // TODO(rohitrao): Eliminate as many of the following delegate methods as |
| 87 // possible. They only exist because the Tab and CRWWebController logic was | 85 // possible. They only exist because the Tab and CRWWebController logic was |
| 88 // very intertwined. We should streamline the logic to jump between classes | 86 // very intertwined. We should streamline the logic to jump between classes |
| 89 // less, then remove any delegate method that becomes unneccessary as a result. | 87 // less, then remove any delegate method that becomes unneccessary as a result. |
| 90 | 88 |
| 91 // Called when the page is reloaded. | 89 // Called when the page is reloaded. |
| 92 - (void)webWillReload; | 90 - (void)webWillReload; |
| 93 // Called when a page is loaded using loadWithParams. In | 91 // Called when a page is loaded using loadWithParams. In |
| 94 // |webWillInitiateLoadWithParams|, the |params| argument is non-const so that | 92 // |webWillInitiateLoadWithParams|, the |params| argument is non-const so that |
| 95 // the delegate can make changes if necessary. | 93 // the delegate can make changes if necessary. |
| 96 // TODO(rohitrao): This is not a great API. Clean it up. | 94 // TODO(rohitrao): This is not a great API. Clean it up. |
| 97 - (void)webWillInitiateLoadWithParams: | 95 - (void)webWillInitiateLoadWithParams: |
| 98 (web::NavigationManager::WebLoadParams&)params; | 96 (web::NavigationManager::WebLoadParams&)params; |
| 99 - (void)webDidUpdateSessionForLoadWithParams: | 97 - (void)webDidUpdateSessionForLoadWithParams: |
| 100 (const web::NavigationManager::WebLoadParams&)params | 98 (const web::NavigationManager::WebLoadParams&)params |
| 101 wasInitialNavigation:(BOOL)initialNavigation; | 99 wasInitialNavigation:(BOOL)initialNavigation; |
| 102 // Called from finishHistoryNavigationFromEntry. | 100 // Called from finishHistoryNavigationFromEntry. |
| 101 // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|. |
| 103 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; | 102 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; |
| 104 // --------------------------------------------------------------------- | 103 // --------------------------------------------------------------------- |
| 105 | 104 |
| 106 @optional | 105 @optional |
| 107 | 106 |
| 108 // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. | 107 // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. |
| 109 // CRWWebDelegate can intercept the request by returning NO and processing URL | 108 // CRWWebDelegate can intercept the request by returning NO and processing URL |
| 110 // in own way. | 109 // in own way. |
| 111 - (BOOL)webController:(CRWWebController*)webController | 110 - (BOOL)webController:(CRWWebController*)webController |
| 112 shouldOpenURL:(const GURL&)url | 111 shouldOpenURL:(const GURL&)url |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Called when a PassKit file is downloaded. |data| should be the data from a | 172 // Called when a PassKit file is downloaded. |data| should be the data from a |
| 174 // PassKit file, but this is not guaranteed, and the delegate is responsible for | 173 // PassKit file, but this is not guaranteed, and the delegate is responsible for |
| 175 // error handling non PassKit data using -[PKPass initWithData:error:]. If the | 174 // error handling non PassKit data using -[PKPass initWithData:error:]. If the |
| 176 // download does not successfully complete, |data| will be nil. | 175 // download does not successfully complete, |data| will be nil. |
| 177 - (void)webController:(CRWWebController*)webController | 176 - (void)webController:(CRWWebController*)webController |
| 178 didLoadPassKitObject:(NSData*)data; | 177 didLoadPassKitObject:(NSData*)data; |
| 179 | 178 |
| 180 @end | 179 @end |
| 181 | 180 |
| 182 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ | 181 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ |
| OLD | NEW |