| 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 29 matching lines...) Expand all Loading... |
| 40 // updating the navigation manager's pending entry. | 40 // updating the navigation manager's pending entry. |
| 41 // Phase will be LOAD_REQUESTED. | 41 // Phase will be LOAD_REQUESTED. |
| 42 - (void)webWillAddPendingURL:(const GURL&)url | 42 - (void)webWillAddPendingURL:(const GURL&)url |
| 43 transition:(ui::PageTransition)transition; | 43 transition:(ui::PageTransition)transition; |
| 44 // Called when webWillStartLoadingURL was called, but something went wrong, and | 44 // Called when webWillStartLoadingURL was called, but something went wrong, and |
| 45 // webDidStartLoadingURL will now never be called. | 45 // webDidStartLoadingURL will now never be called. |
| 46 - (void)webCancelStartLoadingRequest; | 46 - (void)webCancelStartLoadingRequest; |
| 47 // Called when the page URL has changed. Phase will be PAGE_LOADING. Can be | 47 // Called when the page URL has changed. Phase will be PAGE_LOADING. Can be |
| 48 // followed by webDidFinishWithURL or webWillStartLoadingURL. | 48 // followed by webDidFinishWithURL or webWillStartLoadingURL. |
| 49 // |updateHistory| is YES if the URL should be added to the history DB. | 49 // |updateHistory| is YES if the URL should be added to the history DB. |
| 50 // TODO(stuartmorgan): Remove or rename the history param; the history DB | 50 // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|. |
| 51 // isn't a web concept, so this shoud be expressed differently. | |
| 52 - (void)webDidStartLoadingURL:(const GURL&)url | 51 - (void)webDidStartLoadingURL:(const GURL&)url |
| 53 shouldUpdateHistory:(BOOL)updateHistory; | 52 shouldUpdateHistory:(BOOL)updateHistory; |
| 54 // Called when the page load was cancelled by page activity (before a success / | 53 // Called when the page load was cancelled by page activity (before a success / |
| 55 // failure state is known). Phase will be PAGE_LOADED. | 54 // failure state is known). Phase will be PAGE_LOADED. |
| 56 - (void)webLoadCancelled:(const GURL&)url; | 55 - (void)webLoadCancelled:(const GURL&)url; |
| 57 // Called when a page updates its history stack using pushState or replaceState. | 56 // Called when a page updates its history stack using pushState or replaceState. |
| 58 // TODO(stuartmorgan): Generalize this to cover any change of URL without page | 57 // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|. |
| 59 // document change. | |
| 60 - (void)webDidUpdateHistoryStateWithPageURL:(const GURL&)pageUrl; | 58 - (void)webDidUpdateHistoryStateWithPageURL:(const GURL&)pageUrl; |
| 61 // Called when a placeholder image should be displayed instead of the WebView. | 59 // Called when a placeholder image should be displayed instead of the WebView. |
| 62 - (void)webController:(CRWWebController*)webController | 60 - (void)webController:(CRWWebController*)webController |
| 63 retrievePlaceholderOverlayImage:(void (^)(UIImage*))block; | 61 retrievePlaceholderOverlayImage:(void (^)(UIImage*))block; |
| 64 | 62 |
| 65 // --------------------------------------------------------------------- | 63 // --------------------------------------------------------------------- |
| 66 // TODO(rohitrao): Eliminate as many of the following delegate methods as | 64 // TODO(rohitrao): Eliminate as many of the following delegate methods as |
| 67 // possible. They only exist because the Tab and CRWWebController logic was | 65 // possible. They only exist because the Tab and CRWWebController logic was |
| 68 // very intertwined. We should streamline the logic to jump between classes | 66 // very intertwined. We should streamline the logic to jump between classes |
| 69 // less, then remove any delegate method that becomes unneccessary as a result. | 67 // less, then remove any delegate method that becomes unneccessary as a result. |
| 70 | 68 |
| 71 // Called when the page is reloaded. | 69 // Called when the page is reloaded. |
| 72 - (void)webWillReload; | 70 - (void)webWillReload; |
| 73 // Called when a page is loaded using loadWithParams. In | 71 // Called when a page is loaded using loadWithParams. In |
| 74 // |webWillInitiateLoadWithParams|, the |params| argument is non-const so that | 72 // |webWillInitiateLoadWithParams|, the |params| argument is non-const so that |
| 75 // the delegate can make changes if necessary. | 73 // the delegate can make changes if necessary. |
| 76 // TODO(rohitrao): This is not a great API. Clean it up. | 74 // TODO(rohitrao): This is not a great API. Clean it up. |
| 77 - (void)webWillInitiateLoadWithParams: | 75 - (void)webWillInitiateLoadWithParams: |
| 78 (web::NavigationManager::WebLoadParams&)params; | 76 (web::NavigationManager::WebLoadParams&)params; |
| 79 - (void)webDidUpdateSessionForLoadWithParams: | 77 - (void)webDidUpdateSessionForLoadWithParams: |
| 80 (const web::NavigationManager::WebLoadParams&)params | 78 (const web::NavigationManager::WebLoadParams&)params |
| 81 wasInitialNavigation:(BOOL)initialNavigation; | 79 wasInitialNavigation:(BOOL)initialNavigation; |
| 82 // Called from finishHistoryNavigationFromEntry. | 80 // Called from finishHistoryNavigationFromEntry. |
| 81 // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|. |
| 83 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; | 82 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; |
| 84 // --------------------------------------------------------------------- | 83 // --------------------------------------------------------------------- |
| 85 | 84 |
| 86 // Called when |webController| wants to open a new window. |URL| is the URL of | 85 // Called when |webController| wants to open a new window. |URL| is the URL of |
| 87 // the new window; |openerURL| is the URL of the page which requested a window | 86 // the new window; |openerURL| is the URL of the page which requested a window |
| 88 // to be open; |initiatedByUser| is YES if action was caused by the user. | 87 // to be open; |initiatedByUser| is YES if action was caused by the user. |
| 89 // |webController| will not open a window if this method returns nil. This | 88 // |webController| will not open a window if this method returns nil. This |
| 90 // method can not return |webController|. | 89 // method can not return |webController|. |
| 91 - (CRWWebController*)webController:(CRWWebController*)webController | 90 - (CRWWebController*)webController:(CRWWebController*)webController |
| 92 createWebControllerForURL:(const GURL&)URL | 91 createWebControllerForURL:(const GURL&)URL |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Called when a PassKit file is downloaded. |data| should be the data from a | 148 // Called when a PassKit file is downloaded. |data| should be the data from a |
| 150 // PassKit file, but this is not guaranteed, and the delegate is responsible for | 149 // PassKit file, but this is not guaranteed, and the delegate is responsible for |
| 151 // error handling non PassKit data using -[PKPass initWithData:error:]. If the | 150 // error handling non PassKit data using -[PKPass initWithData:error:]. If the |
| 152 // download does not successfully complete, |data| will be nil. | 151 // download does not successfully complete, |data| will be nil. |
| 153 - (void)webController:(CRWWebController*)webController | 152 - (void)webController:(CRWWebController*)webController |
| 154 didLoadPassKitObject:(NSData*)data; | 153 didLoadPassKitObject:(NSData*)data; |
| 155 | 154 |
| 156 @end | 155 @end |
| 157 | 156 |
| 158 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ | 157 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_WEB_DELEGATE_H_ |
| OLD | NEW |