| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 WebFrame*, const WebURLRequest&, WebNavigationPolicy) { } | 83 WebFrame*, const WebURLRequest&, WebNavigationPolicy) { } |
| 84 | 84 |
| 85 | 85 |
| 86 // Navigational queries ------------------------------------------------ | 86 // Navigational queries ------------------------------------------------ |
| 87 | 87 |
| 88 // The client may choose to alter the navigation policy. Otherwise, | 88 // The client may choose to alter the navigation policy. Otherwise, |
| 89 // defaultPolicy should just be returned. | 89 // defaultPolicy should just be returned. |
| 90 virtual WebNavigationPolicy decidePolicyForNavigation( | 90 virtual WebNavigationPolicy decidePolicyForNavigation( |
| 91 WebFrame*, const WebURLRequest&, WebNavigationType, | 91 WebFrame*, const WebURLRequest&, WebNavigationType, |
| 92 const WebNode& originatingNode, | 92 const WebNode& originatingNode, |
| 93 WebNavigationPolicy defaultPolicy, bool isRedirect) | 93 WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPolicy; } |
| 94 { | |
| 95 return defaultPolicy; | |
| 96 } | |
| 97 | 94 |
| 98 // Query if the specified request can be handled. | 95 // Query if the specified request can be handled. |
| 99 virtual bool canHandleRequest( | 96 virtual bool canHandleRequest( |
| 100 WebFrame*, const WebURLRequest& request) { return true; } | 97 WebFrame*, const WebURLRequest& request) { return true; } |
| 101 | 98 |
| 102 // Returns an error corresponding to canHandledRequest() returning false. | 99 // Returns an error corresponding to canHandledRequest() returning false. |
| 103 virtual WebURLError cannotHandleRequestError( | 100 virtual WebURLError cannotHandleRequestError( |
| 104 WebFrame*, const WebURLRequest& request) { return WebURLError(); } | 101 WebFrame*, const WebURLRequest& request) { return WebURLError(); } |
| 105 | 102 |
| 106 // Returns an error corresponding to a user cancellation event. | 103 // Returns an error corresponding to a user cancellation event. |
| 107 virtual WebURLError cancelledError( | 104 virtual WebURLError cancelledError( |
| 108 WebFrame*, const WebURLRequest& request) { return WebURLError(); } | 105 WebFrame*, const WebURLRequest& request) { return WebURLError(); } |
| 109 | 106 |
| 110 // Notify that a URL cannot be handled. | 107 // Notify that a URL cannot be handled. |
| 111 virtual void unableToImplementPolicyWithError( | 108 virtual void unableToImplementPolicyWithError( |
| 112 WebFrame*, const WebURLError&) { }; | 109 WebFrame*, const WebURLError&) { } |
| 113 | 110 |
| 114 | 111 |
| 115 // Navigational notifications ------------------------------------------ | 112 // Navigational notifications ------------------------------------------ |
| 116 | 113 |
| 117 // A form submission is about to occur. | 114 // A form submission is about to occur. |
| 118 virtual void willSubmitForm(WebFrame*, const WebForm&) { }; | 115 virtual void willSubmitForm(WebFrame*, const WebForm&) { } |
| 119 | 116 |
| 120 // A client-side redirect will occur. This may correspond to a <META | 117 // A client-side redirect will occur. This may correspond to a <META |
| 121 // refresh> or some script activity. | 118 // refresh> or some script activity. |
| 122 virtual void willPerformClientRedirect( | 119 virtual void willPerformClientRedirect( |
| 123 WebFrame*, const WebURL& from, const WebURL& to, | 120 WebFrame*, const WebURL& from, const WebURL& to, |
| 124 double interval, double fireTime) { }; | 121 double interval, double fireTime) { } |
| 125 | 122 |
| 126 // A client-side redirect was cancelled. | 123 // A client-side redirect was cancelled. |
| 127 virtual void didCancelClientRedirect(WebFrame*) { } | 124 virtual void didCancelClientRedirect(WebFrame*) { } |
| 128 | 125 |
| 129 // A client-side redirect completed. | 126 // A client-side redirect completed. |
| 130 virtual void didCompleteClientRedirect(WebFrame*, const WebURL& fromURL) { } | 127 virtual void didCompleteClientRedirect(WebFrame*, const WebURL& fromURL) { } |
| 131 | 128 |
| 132 // A datasource has been created for a new navigation. The given | 129 // A datasource has been created for a new navigation. The given |
| 133 // datasource will become the provisional datasource for the frame. | 130 // datasource will become the provisional datasource for the frame. |
| 134 virtual void didCreateDataSource(WebFrame*, WebDataSource*) { } | 131 virtual void didCreateDataSource(WebFrame*, WebDataSource*) { } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 virtual void didDisplayInsecureContent(WebFrame*) { } | 224 virtual void didDisplayInsecureContent(WebFrame*) { } |
| 228 | 225 |
| 229 // The indicated security origin has run active content (such as a | 226 // The indicated security origin has run active content (such as a |
| 230 // script) from an insecure source. Note that the insecure content can | 227 // script) from an insecure source. Note that the insecure content can |
| 231 // spread to other frames in the same origin. | 228 // spread to other frames in the same origin. |
| 232 virtual void didRunInsecureContent(WebFrame*, const WebSecurityOrigin&) { } | 229 virtual void didRunInsecureContent(WebFrame*, const WebSecurityOrigin&) { } |
| 233 | 230 |
| 234 | 231 |
| 235 // Script notifications ------------------------------------------------ | 232 // Script notifications ------------------------------------------------ |
| 236 | 233 |
| 234 // Controls whether scripts are allowed to execute for this frame. |
| 235 virtual bool allowScript(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } |
| 236 |
| 237 // Script in the page tried to allocate too much memory. | 237 // Script in the page tried to allocate too much memory. |
| 238 virtual void didExhaustMemoryAvailableForScript(WebFrame*) { } | 238 virtual void didExhaustMemoryAvailableForScript(WebFrame*) { } |
| 239 | 239 |
| 240 // Notifies that a new script context has been created for this frame. | 240 // Notifies that a new script context has been created for this frame. |
| 241 // This is similar to didClearWindowObject but only called once per | 241 // This is similar to didClearWindowObject but only called once per |
| 242 // frame context. | 242 // frame context. |
| 243 virtual void didCreateScriptContext(WebFrame*) { } | 243 virtual void didCreateScriptContext(WebFrame*) { } |
| 244 | 244 |
| 245 // Notifies that this frame's script context has been destroyed. | 245 // Notifies that this frame's script context has been destroyed. |
| 246 virtual void didDestroyScriptContext(WebFrame*) { } | 246 virtual void didDestroyScriptContext(WebFrame*) { } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 273 virtual void reportFindInPageSelection( | 273 virtual void reportFindInPageSelection( |
| 274 int identifier, int activeMatchOrdinal, const WebRect& selection) { } | 274 int identifier, int activeMatchOrdinal, const WebRect& selection) { } |
| 275 | 275 |
| 276 protected: | 276 protected: |
| 277 ~WebFrameClient() { } | 277 ~WebFrameClient() { } |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 } // namespace WebKit | 280 } // namespace WebKit |
| 281 | 281 |
| 282 #endif | 282 #endif |
| OLD | NEW |