| 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_CRW_WEB_CONTROLLER_OBSERVER_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_CRW_WEB_CONTROLLER_OBSERVER_H_ |
| 6 #define IOS_WEB_PUBLIC_WEB_STATE_CRW_WEB_CONTROLLER_OBSERVER_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_CRW_WEB_CONTROLLER_OBSERVER_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #include <string> | |
| 10 | 9 |
| 11 @class CRWWebController; | 10 @class CRWWebController; |
| 12 @protocol CRWWebViewProxy; | 11 @protocol CRWWebViewProxy; |
| 13 class GURL; | |
| 14 @class UIWebView; | |
| 15 | |
| 16 namespace base { | |
| 17 class DictionaryValue; | |
| 18 } | |
| 19 | 12 |
| 20 // NOTE: When adding new methods to CRWWebControllerObserver, consider adding | 13 // NOTE: When adding new methods to CRWWebControllerObserver, consider adding |
| 21 // them to WebStateObserver instead if they need to be surfaced to the public | 14 // them to WebStateObserver instead if they need to be surfaced to the public |
| 22 // API. | 15 // API. |
| 23 @protocol CRWWebControllerObserver<NSObject> | 16 @protocol CRWWebControllerObserver<NSObject> |
| 24 | 17 |
| 25 @optional | 18 @optional |
| 26 | 19 |
| 27 // Supplies a text prefix to the CRWWebController to indicate which commands the | |
| 28 // observer should receive using the handleCommand message. | |
| 29 // Called only as the observer is added to its parent CRWWebController. | |
| 30 @property(nonatomic, readonly) NSString* commandPrefix; | |
| 31 | |
| 32 // Called when the current page is loaded. | 20 // Called when the current page is loaded. |
| 33 // DEPRECATED: Use WebStateObserver instead. | 21 // DEPRECATED: Use WebStateObserver instead. |
| 34 - (void)pageLoaded:(CRWWebController*)webController; | 22 - (void)pageLoaded:(CRWWebController*)webController; |
| 35 | 23 |
| 36 // Called when the web controller is about to close. | 24 // Called when the web controller is about to close. |
| 37 - (void)webControllerWillClose:(CRWWebController*)webController; | 25 - (void)webControllerWillClose:(CRWWebController*)webController; |
| 38 | 26 |
| 39 // Handle the command from page scripts. Return NO if the command was known to | |
| 40 // be invalid. This will cause the page to be reset as a security precaution. | |
| 41 // DEPRECATED: Use WebState::ScriptCommandCallback instead. | |
| 42 - (BOOL)handleCommand:(const base::DictionaryValue&)command | |
| 43 webController:(CRWWebController*)webController | |
| 44 userIsInteracting:(BOOL)userIsInteracting | |
| 45 originURL:(const GURL&)originURL; | |
| 46 | |
| 47 // Gives CRWWebControllerObservers access to the CRWWebViewProxy. | 27 // Gives CRWWebControllerObservers access to the CRWWebViewProxy. |
| 48 - (void)setWebViewProxy:(id<CRWWebViewProxy>)webView | 28 - (void)setWebViewProxy:(id<CRWWebViewProxy>)webView |
| 49 controller:(CRWWebController*)webController; | 29 controller:(CRWWebController*)webController; |
| 50 | 30 |
| 51 @end | 31 @end |
| 52 | 32 |
| 53 #endif // IOS_WEB_PUBLIC_WEB_STATE_CRW_WEB_CONTROLLER_OBSERVER_H_ | 33 #endif // IOS_WEB_PUBLIC_WEB_STATE_CRW_WEB_CONTROLLER_OBSERVER_H_ |
| OLD | NEW |