| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebFrameClient_h | 31 #ifndef WebFrameClient_h |
| 32 #define WebFrameClient_h | 32 #define WebFrameClient_h |
| 33 | 33 |
| 34 #include "WebDOMMessageEvent.h" | 34 #include "WebDOMMessageEvent.h" |
| 35 #include "WebDataSource.h" | 35 #include "WebDataSource.h" |
| 36 #include "WebFrame.h" | |
| 37 #include "WebIconURL.h" | 36 #include "WebIconURL.h" |
| 38 #include "WebNavigationPolicy.h" | 37 #include "WebNavigationPolicy.h" |
| 39 #include "WebNavigationType.h" | 38 #include "WebNavigationType.h" |
| 40 #include "WebSecurityOrigin.h" | 39 #include "WebSecurityOrigin.h" |
| 41 #include "WebTextDirection.h" | 40 #include "WebTextDirection.h" |
| 42 #include "public/platform/WebCommon.h" | 41 #include "public/platform/WebCommon.h" |
| 43 #include "public/platform/WebFileSystem.h" | 42 #include "public/platform/WebFileSystem.h" |
| 44 #include "public/platform/WebFileSystemType.h" | 43 #include "public/platform/WebFileSystemType.h" |
| 45 #include "public/platform/WebStorageQuotaCallbacks.h" | 44 #include "public/platform/WebStorageQuotaCallbacks.h" |
| 46 #include "public/platform/WebStorageQuotaType.h" | 45 #include "public/platform/WebStorageQuotaType.h" |
| 47 #include "public/platform/WebURLError.h" | 46 #include "public/platform/WebURLError.h" |
| 48 #include "public/platform/WebURLRequest.h" | 47 #include "public/platform/WebURLRequest.h" |
| 49 #include <v8.h> | 48 #include <v8.h> |
| 50 | 49 |
| 51 namespace blink { | 50 namespace blink { |
| 52 | 51 |
| 53 class WebApplicationCacheHost; | 52 class WebApplicationCacheHost; |
| 54 class WebApplicationCacheHostClient; | 53 class WebApplicationCacheHostClient; |
| 55 class WebCachedURLRequest; | 54 class WebCachedURLRequest; |
| 56 class WebCookieJar; | 55 class WebCookieJar; |
| 57 class WebDataSource; | 56 class WebDataSource; |
| 58 class WebDOMEvent; | 57 class WebDOMEvent; |
| 59 class WebFormElement; | 58 class WebFormElement; |
| 59 class WebFrame; |
| 60 class WebInputEvent; | 60 class WebInputEvent; |
| 61 class WebMediaPlayer; | 61 class WebMediaPlayer; |
| 62 class WebMediaPlayerClient; | 62 class WebMediaPlayerClient; |
| 63 class WebServiceWorkerProvider; | 63 class WebServiceWorkerProvider; |
| 64 class WebServiceWorkerProviderClient; | 64 class WebServiceWorkerProviderClient; |
| 65 class WebNode; | 65 class WebNode; |
| 66 class WebPlugin; | 66 class WebPlugin; |
| 67 class WebRTCPeerConnectionHandler; | 67 class WebRTCPeerConnectionHandler; |
| 68 class WebSharedWorker; | 68 class WebSharedWorker; |
| 69 class WebSharedWorkerClient; | 69 class WebSharedWorkerClient; |
| 70 class WebSocketStreamHandle; | 70 class WebSocketStreamHandle; |
| 71 class WebString; | 71 class WebString; |
| 72 class WebURL; | 72 class WebURL; |
| 73 class WebURLLoader; | 73 class WebURLLoader; |
| 74 class WebURLResponse; | 74 class WebURLResponse; |
| 75 class WebWorkerPermissionClientProxy; | 75 class WebWorkerPermissionClientProxy; |
| 76 struct WebContextMenuData; | 76 struct WebContextMenuData; |
| 77 struct WebPluginParams; | 77 struct WebPluginParams; |
| 78 struct WebRect; | 78 struct WebRect; |
| 79 struct WebSize; | 79 struct WebSize; |
| 80 struct WebURLError; | 80 struct WebURLError; |
| 81 | 81 |
| 82 class WebFrameClient { | 82 class WebFrameClient { |
| 83 public: | 83 public: |
| 84 // Factory methods ----------------------------------------------------- | 84 // Factory methods ----------------------------------------------------- |
| 85 | 85 |
| 86 // May return null. | 86 // May return null. |
| 87 virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { re
turn 0; } | 87 virtual WebPlugin* createPlugin(WebFrame*, const WebPluginParams&) { return
0; } |
| 88 | 88 |
| 89 // May return null. | 89 // May return null. |
| 90 virtual WebMediaPlayer* createMediaPlayer(WebLocalFrame*, const WebURL&, Web
MediaPlayerClient*) { return 0; } | 90 virtual WebMediaPlayer* createMediaPlayer(WebFrame*, const WebURL&, WebMedia
PlayerClient*) { return 0; } |
| 91 | 91 |
| 92 // May return null. | 92 // May return null. |
| 93 virtual WebApplicationCacheHost* createApplicationCacheHost(WebLocalFrame*,
WebApplicationCacheHostClient*) { return 0; } | 93 virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebAp
plicationCacheHostClient*) { return 0; } |
| 94 | 94 |
| 95 // May return null. Takes ownership of the client. | 95 // May return null. Takes ownership of the client. |
| 96 // FIXME: Deprecate the second argument. | 96 // FIXME: Deprecate the second argument. |
| 97 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebLocalFrame*
, WebServiceWorkerProviderClient*) { return 0; } | 97 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebFrame*, Web
ServiceWorkerProviderClient*) { return 0; } |
| 98 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebLocalFrame*
frame) { return createServiceWorkerProvider(frame, 0); } | 98 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebFrame* fram
e) { return createServiceWorkerProvider(frame, 0); } |
| 99 | 99 |
| 100 // May return null. | 100 // May return null. |
| 101 virtual WebWorkerPermissionClientProxy* createWorkerPermissionClientProxy(We
bLocalFrame*) { return 0; } | 101 virtual WebWorkerPermissionClientProxy* createWorkerPermissionClientProxy(We
bFrame*) { return 0; } |
| 102 | 102 |
| 103 | 103 |
| 104 // Services ------------------------------------------------------------ | 104 // Services ------------------------------------------------------------ |
| 105 | 105 |
| 106 // A frame specific cookie jar. May return null, in which case | 106 // A frame specific cookie jar. May return null, in which case |
| 107 // WebKitPlatformSupport::cookieJar() will be called to access cookies. | 107 // WebKitPlatformSupport::cookieJar() will be called to access cookies. |
| 108 virtual WebCookieJar* cookieJar(WebLocalFrame*) { return 0; } | 108 virtual WebCookieJar* cookieJar(WebFrame*) { return 0; } |
| 109 | 109 |
| 110 | 110 |
| 111 // General notifications ----------------------------------------------- | 111 // General notifications ----------------------------------------------- |
| 112 | 112 |
| 113 // Indicates that another page has accessed the DOM of the initial empty | 113 // Indicates that another page has accessed the DOM of the initial empty |
| 114 // document of a main frame. After this, it is no longer safe to show a | 114 // document of a main frame. After this, it is no longer safe to show a |
| 115 // pending navigation's URL, because a URL spoof is possible. | 115 // pending navigation's URL, because a URL spoof is possible. |
| 116 virtual void didAccessInitialDocument(WebLocalFrame*) { } | 116 virtual void didAccessInitialDocument(WebFrame*) { } |
| 117 | 117 |
| 118 // A child frame was created in this frame. This is called when the frame | 118 // A child frame was created in this frame. This is called when the frame |
| 119 // is created and initialized. Takes the name of the new frame, the parent | 119 // is created and initialized. Takes the name of the new frame, the parent |
| 120 // frame and returns a new WebFrame. The WebFrame is considered in-use | 120 // frame and returns a new WebFrame. The WebFrame is considered in-use |
| 121 // until frameDetached() is called on it. | 121 // until frameDetached() is called on it. |
| 122 // Note: If you override this, you should almost certainly be overriding | 122 // Note: If you override this, you should almost certainly be overriding |
| 123 // frameDetached(). | 123 // frameDetached(). |
| 124 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f
rameName) { return 0; } | 124 virtual WebFrame* createChildFrame(WebFrame* parent, const WebString& frameN
ame) { return 0; } |
| 125 | 125 |
| 126 // This frame set its opener to null, disowning it. | 126 // This frame set its opener to null, disowning it. |
| 127 // See http://html.spec.whatwg.org/#dom-opener. | 127 // See http://html.spec.whatwg.org/#dom-opener. |
| 128 virtual void didDisownOpener(WebLocalFrame*) { } | 128 virtual void didDisownOpener(WebFrame*) { } |
| 129 | 129 |
| 130 // This frame has been detached from the view, but has not been closed yet. | 130 // This frame has been detached from the view, but has not been closed yet. |
| 131 virtual void frameDetached(WebFrame*) { } | 131 virtual void frameDetached(WebFrame*) { } |
| 132 | 132 |
| 133 // This frame has become focused.. | 133 // This frame has become focused.. |
| 134 virtual void frameFocused() { } | 134 virtual void frameFocused() { } |
| 135 | 135 |
| 136 // This frame is about to be closed. This is called after frameDetached, | 136 // This frame is about to be closed. This is called after frameDetached, |
| 137 // when the document is being unloaded, due to new one committing. | 137 // when the document is being unloaded, due to new one committing. |
| 138 virtual void willClose(WebLocalFrame*) { } | 138 virtual void willClose(WebFrame*) { } |
| 139 | 139 |
| 140 // This frame's name has changed. | 140 // This frame's name has changed. |
| 141 virtual void didChangeName(WebLocalFrame*, const WebString&) { } | 141 virtual void didChangeName(WebFrame*, const WebString&) { } |
| 142 | 142 |
| 143 // Called when a watched CSS selector matches or stops matching. | 143 // Called when a watched CSS selector matches or stops matching. |
| 144 virtual void didMatchCSS(WebLocalFrame*, const WebVector<WebString>& newlyMa
tchingSelectors, const WebVector<WebString>& stoppedMatchingSelectors) { } | 144 virtual void didMatchCSS(WebFrame*, const WebVector<WebString>& newlyMatchin
gSelectors, const WebVector<WebString>& stoppedMatchingSelectors) { } |
| 145 | 145 |
| 146 // Load commands ------------------------------------------------------- | 146 // Load commands ------------------------------------------------------- |
| 147 | 147 |
| 148 // The client should handle the navigation externally. | 148 // The client should handle the navigation externally. |
| 149 virtual void loadURLExternally( | 149 virtual void loadURLExternally( |
| 150 WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy) { } | 150 WebFrame*, const WebURLRequest&, WebNavigationPolicy) { } |
| 151 virtual void loadURLExternally( | 151 virtual void loadURLExternally( |
| 152 WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy, const WebStri
ng& downloadName) { } | 152 WebFrame*, const WebURLRequest&, WebNavigationPolicy, const WebString& d
ownloadName) { } |
| 153 | 153 |
| 154 | 154 |
| 155 // Navigational queries ------------------------------------------------ | 155 // Navigational queries ------------------------------------------------ |
| 156 | 156 |
| 157 // The client may choose to alter the navigation policy. Otherwise, | 157 // The client may choose to alter the navigation policy. Otherwise, |
| 158 // defaultPolicy should just be returned. | 158 // defaultPolicy should just be returned. |
| 159 virtual WebNavigationPolicy decidePolicyForNavigation( | 159 virtual WebNavigationPolicy decidePolicyForNavigation( |
| 160 WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavi
gationType, | 160 WebFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavigatio
nType, |
| 161 WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPoli
cy; } | 161 WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPoli
cy; } |
| 162 | 162 |
| 163 | 163 |
| 164 // Navigational notifications ------------------------------------------ | 164 // Navigational notifications ------------------------------------------ |
| 165 | 165 |
| 166 // A form submission has been requested, but the page's submit event handler | 166 // A form submission has been requested, but the page's submit event handler |
| 167 // hasn't yet had a chance to run (and possibly alter/interrupt the submit.) | 167 // hasn't yet had a chance to run (and possibly alter/interrupt the submit.) |
| 168 virtual void willSendSubmitEvent(WebLocalFrame*, const WebFormElement&) { } | 168 virtual void willSendSubmitEvent(WebFrame*, const WebFormElement&) { } |
| 169 | 169 |
| 170 // A form submission is about to occur. | 170 // A form submission is about to occur. |
| 171 virtual void willSubmitForm(WebLocalFrame*, const WebFormElement&) { } | 171 virtual void willSubmitForm(WebFrame*, const WebFormElement&) { } |
| 172 | 172 |
| 173 // A datasource has been created for a new navigation. The given | 173 // A datasource has been created for a new navigation. The given |
| 174 // datasource will become the provisional datasource for the frame. | 174 // datasource will become the provisional datasource for the frame. |
| 175 virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) { } | 175 virtual void didCreateDataSource(WebFrame*, WebDataSource*) { } |
| 176 | 176 |
| 177 // A new provisional load has been started. | 177 // A new provisional load has been started. |
| 178 virtual void didStartProvisionalLoad(WebLocalFrame*) { } | 178 virtual void didStartProvisionalLoad(WebFrame*) { } |
| 179 | 179 |
| 180 // The provisional load was redirected via a HTTP 3xx response. | 180 // The provisional load was redirected via a HTTP 3xx response. |
| 181 virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) { } | 181 virtual void didReceiveServerRedirectForProvisionalLoad(WebFrame*) { } |
| 182 | 182 |
| 183 // The provisional load failed. | 183 // The provisional load failed. |
| 184 virtual void didFailProvisionalLoad(WebLocalFrame*, const WebURLError&) { } | 184 virtual void didFailProvisionalLoad(WebFrame*, const WebURLError&) { } |
| 185 | 185 |
| 186 // The provisional datasource is now committed. The first part of the | 186 // The provisional datasource is now committed. The first part of the |
| 187 // response body has been received, and the encoding of the response | 187 // response body has been received, and the encoding of the response |
| 188 // body is known. | 188 // body is known. |
| 189 virtual void didCommitProvisionalLoad(WebLocalFrame*, bool isNewNavigation)
{ } | 189 virtual void didCommitProvisionalLoad(WebFrame*, bool isNewNavigation) { } |
| 190 | 190 |
| 191 // The window object for the frame has been cleared of any extra | 191 // The window object for the frame has been cleared of any extra |
| 192 // properties that may have been set by script from the previously | 192 // properties that may have been set by script from the previously |
| 193 // loaded document. | 193 // loaded document. |
| 194 virtual void didClearWindowObject(WebLocalFrame* frame, int worldId) { } | 194 virtual void didClearWindowObject(WebFrame* frame, int worldId) { } |
| 195 | 195 |
| 196 // The document element has been created. | 196 // The document element has been created. |
| 197 virtual void didCreateDocumentElement(WebLocalFrame*) { } | 197 virtual void didCreateDocumentElement(WebFrame*) { } |
| 198 | 198 |
| 199 // The page title is available. | 199 // The page title is available. |
| 200 virtual void didReceiveTitle(WebLocalFrame* frame, const WebString& title, W
ebTextDirection direction) { } | 200 virtual void didReceiveTitle(WebFrame* frame, const WebString& title, WebTex
tDirection direction) { } |
| 201 | 201 |
| 202 // The icon for the page have changed. | 202 // The icon for the page have changed. |
| 203 virtual void didChangeIcon(WebLocalFrame*, WebIconURL::Type) { } | 203 virtual void didChangeIcon(WebFrame*, WebIconURL::Type) { } |
| 204 | 204 |
| 205 // The frame's document finished loading. | 205 // The frame's document finished loading. |
| 206 virtual void didFinishDocumentLoad(WebLocalFrame*) { } | 206 virtual void didFinishDocumentLoad(WebFrame*) { } |
| 207 | 207 |
| 208 // The 'load' event was dispatched. | 208 // The 'load' event was dispatched. |
| 209 virtual void didHandleOnloadEvents(WebLocalFrame*) { } | 209 virtual void didHandleOnloadEvents(WebFrame*) { } |
| 210 | 210 |
| 211 // The frame's document or one of its subresources failed to load. | 211 // The frame's document or one of its subresources failed to load. |
| 212 virtual void didFailLoad(WebLocalFrame*, const WebURLError&) { } | 212 virtual void didFailLoad(WebFrame*, const WebURLError&) { } |
| 213 | 213 |
| 214 // The frame's document and all of its subresources succeeded to load. | 214 // The frame's document and all of its subresources succeeded to load. |
| 215 virtual void didFinishLoad(WebLocalFrame*) { } | 215 virtual void didFinishLoad(WebFrame*) { } |
| 216 | 216 |
| 217 // The navigation resulted in no change to the documents within the page. | 217 // The navigation resulted in no change to the documents within the page. |
| 218 // For example, the navigation may have just resulted in scrolling to a | 218 // For example, the navigation may have just resulted in scrolling to a |
| 219 // named anchor or a PopState event may have been dispatched. | 219 // named anchor or a PopState event may have been dispatched. |
| 220 virtual void didNavigateWithinPage(WebLocalFrame*, bool isNewNavigation) { } | 220 virtual void didNavigateWithinPage(WebFrame*, bool isNewNavigation) { } |
| 221 | 221 |
| 222 // Called upon update to scroll position, document state, and other | 222 // Called upon update to scroll position, document state, and other |
| 223 // non-navigational events related to the data held by WebHistoryItem. | 223 // non-navigational events related to the data held by WebHistoryItem. |
| 224 // WARNING: This method may be called very frequently. | 224 // WARNING: This method may be called very frequently. |
| 225 virtual void didUpdateCurrentHistoryItem(WebLocalFrame*) { } | 225 virtual void didUpdateCurrentHistoryItem(WebFrame*) { } |
| 226 | 226 |
| 227 // Editing ------------------------------------------------------------- | 227 // Editing ------------------------------------------------------------- |
| 228 | 228 |
| 229 // These methods allow the client to intercept and overrule editing | 229 // These methods allow the client to intercept and overrule editing |
| 230 // operations. | 230 // operations. |
| 231 virtual void didChangeSelection(bool isSelectionEmpty) { } | 231 virtual void didChangeSelection(bool isSelectionEmpty) { } |
| 232 | 232 |
| 233 | 233 |
| 234 // UI ------------------------------------------------------------------ | 234 // UI ------------------------------------------------------------------ |
| 235 | 235 |
| 236 // Shows a context menu with commands relevant to a specific element on | 236 // Shows a context menu with commands relevant to a specific element on |
| 237 // the given frame. Additional context data is supplied. | 237 // the given frame. Additional context data is supplied. |
| 238 virtual void showContextMenu(const WebContextMenuData&) { } | 238 virtual void showContextMenu(const WebContextMenuData&) { } |
| 239 | 239 |
| 240 // Called when the data attached to the currently displayed context menu is | 240 // Called when the data attached to the currently displayed context menu is |
| 241 // invalidated. The context menu may be closed if possible. | 241 // invalidated. The context menu may be closed if possible. |
| 242 virtual void clearContextMenu() { } | 242 virtual void clearContextMenu() { } |
| 243 | 243 |
| 244 | 244 |
| 245 // Low-level resource notifications ------------------------------------ | 245 // Low-level resource notifications ------------------------------------ |
| 246 | 246 |
| 247 // An element will request a resource. | 247 // An element will request a resource. |
| 248 virtual void willRequestResource(WebLocalFrame*, const WebCachedURLRequest&)
{ } | 248 virtual void willRequestResource(WebFrame*, const WebCachedURLRequest&) { } |
| 249 | 249 |
| 250 // The request is after preconnect is triggered. | 250 // The request is after preconnect is triggered. |
| 251 virtual void willRequestAfterPreconnect(WebLocalFrame*, WebURLRequest&) { } | 251 virtual void willRequestAfterPreconnect(WebFrame*, WebURLRequest&) { } |
| 252 | 252 |
| 253 // A request is about to be sent out, and the client may modify it. Request | 253 // A request is about to be sent out, and the client may modify it. Request |
| 254 // is writable, and changes to the URL, for example, will change the request | 254 // is writable, and changes to the URL, for example, will change the request |
| 255 // made. If this request is the result of a redirect, then redirectResponse | 255 // made. If this request is the result of a redirect, then redirectResponse |
| 256 // will be non-null and contain the response that triggered the redirect. | 256 // will be non-null and contain the response that triggered the redirect. |
| 257 virtual void willSendRequest( | 257 virtual void willSendRequest( |
| 258 WebLocalFrame*, unsigned identifier, WebURLRequest&, | 258 WebFrame*, unsigned identifier, WebURLRequest&, |
| 259 const WebURLResponse& redirectResponse) { } | 259 const WebURLResponse& redirectResponse) { } |
| 260 | 260 |
| 261 // Response headers have been received for the resource request given | 261 // Response headers have been received for the resource request given |
| 262 // by identifier. | 262 // by identifier. |
| 263 virtual void didReceiveResponse( | 263 virtual void didReceiveResponse( |
| 264 WebLocalFrame*, unsigned identifier, const WebURLResponse&) { } | 264 WebFrame*, unsigned identifier, const WebURLResponse&) { } |
| 265 | 265 |
| 266 virtual void didChangeResourcePriority( | 266 virtual void didChangeResourcePriority( |
| 267 WebLocalFrame*, unsigned identifier, const blink::WebURLRequest::Priorit
y&) { } | 267 WebFrame*, unsigned identifier, const blink::WebURLRequest::Priority&) {
} |
| 268 | 268 |
| 269 // The resource request given by identifier succeeded. | 269 // The resource request given by identifier succeeded. |
| 270 virtual void didFinishResourceLoad( | 270 virtual void didFinishResourceLoad( |
| 271 WebLocalFrame*, unsigned identifier) { } | 271 WebFrame*, unsigned identifier) { } |
| 272 | 272 |
| 273 // The specified request was satified from WebCore's memory cache. | 273 // The specified request was satified from WebCore's memory cache. |
| 274 virtual void didLoadResourceFromMemoryCache( | 274 virtual void didLoadResourceFromMemoryCache( |
| 275 WebLocalFrame*, const WebURLRequest&, const WebURLResponse&) { } | 275 WebFrame*, const WebURLRequest&, const WebURLResponse&) { } |
| 276 | 276 |
| 277 // This frame has displayed inactive content (such as an image) from an | 277 // This frame has displayed inactive content (such as an image) from an |
| 278 // insecure source. Inactive content cannot spread to other frames. | 278 // insecure source. Inactive content cannot spread to other frames. |
| 279 virtual void didDisplayInsecureContent(WebLocalFrame*) { } | 279 virtual void didDisplayInsecureContent(WebFrame*) { } |
| 280 | 280 |
| 281 // The indicated security origin has run active content (such as a | 281 // The indicated security origin has run active content (such as a |
| 282 // script) from an insecure source. Note that the insecure content can | 282 // script) from an insecure source. Note that the insecure content can |
| 283 // spread to other frames in the same origin. | 283 // spread to other frames in the same origin. |
| 284 virtual void didRunInsecureContent(WebLocalFrame*, const WebSecurityOrigin&,
const WebURL& insecureURL) { } | 284 virtual void didRunInsecureContent(WebFrame*, const WebSecurityOrigin&, cons
t WebURL& insecureURL) { } |
| 285 | 285 |
| 286 // A reflected XSS was encountered in the page and suppressed. | 286 // A reflected XSS was encountered in the page and suppressed. |
| 287 virtual void didDetectXSS(WebLocalFrame*, const WebURL&, bool didBlockEntire
Page) { } | 287 virtual void didDetectXSS(WebFrame*, const WebURL&, bool didBlockEntirePage)
{ } |
| 288 | 288 |
| 289 // A PingLoader was created, and a request dispatched to a URL. | 289 // A PingLoader was created, and a request dispatched to a URL. |
| 290 virtual void didDispatchPingLoader(WebLocalFrame*, const WebURL&) { } | 290 virtual void didDispatchPingLoader(WebFrame*, const WebURL&) { } |
| 291 | 291 |
| 292 // The loaders in this frame have been stopped. | 292 // The loaders in this frame have been stopped. |
| 293 virtual void didAbortLoading(WebLocalFrame*) { } | 293 virtual void didAbortLoading(WebFrame*) { } |
| 294 | 294 |
| 295 // Script notifications ------------------------------------------------ | 295 // Script notifications ------------------------------------------------ |
| 296 | 296 |
| 297 // Notifies that a new script context has been created for this frame. | 297 // Notifies that a new script context has been created for this frame. |
| 298 // This is similar to didClearWindowObject but only called once per | 298 // This is similar to didClearWindowObject but only called once per |
| 299 // frame context. | 299 // frame context. |
| 300 virtual void didCreateScriptContext(WebLocalFrame*, v8::Handle<v8::Context>,
int extensionGroup, int worldId) { } | 300 virtual void didCreateScriptContext(WebFrame*, v8::Handle<v8::Context>, int
extensionGroup, int worldId) { } |
| 301 | 301 |
| 302 // WebKit is about to release its reference to a v8 context for a frame. | 302 // WebKit is about to release its reference to a v8 context for a frame. |
| 303 virtual void willReleaseScriptContext(WebLocalFrame*, v8::Handle<v8::Context
>, int worldId) { } | 303 virtual void willReleaseScriptContext(WebFrame*, v8::Handle<v8::Context>, in
t worldId) { } |
| 304 | 304 |
| 305 // Geometry notifications ---------------------------------------------- | 305 // Geometry notifications ---------------------------------------------- |
| 306 | 306 |
| 307 // The frame's document finished the initial non-empty layout of a page. | 307 // The frame's document finished the initial non-empty layout of a page. |
| 308 virtual void didFirstVisuallyNonEmptyLayout(WebLocalFrame*) { } | 308 virtual void didFirstVisuallyNonEmptyLayout(WebFrame*) { } |
| 309 | 309 |
| 310 // The size of the content area changed. | 310 // The size of the content area changed. |
| 311 virtual void didChangeContentsSize(WebLocalFrame*, const WebSize&) { } | 311 virtual void didChangeContentsSize(WebFrame*, const WebSize&) { } |
| 312 | 312 |
| 313 // The main frame scrolled. | 313 // The main frame scrolled. |
| 314 virtual void didChangeScrollOffset(WebLocalFrame*) { } | 314 virtual void didChangeScrollOffset(WebFrame*) { } |
| 315 | 315 |
| 316 // If the frame is loading an HTML document, this will be called to | 316 // If the frame is loading an HTML document, this will be called to |
| 317 // notify that the <body> will be attached soon. | 317 // notify that the <body> will be attached soon. |
| 318 virtual void willInsertBody(WebLocalFrame*) { } | 318 virtual void willInsertBody(WebFrame*) { } |
| 319 | 319 |
| 320 // Find-in-page notifications ------------------------------------------ | 320 // Find-in-page notifications ------------------------------------------ |
| 321 | 321 |
| 322 // Notifies how many matches have been found so far, for a given | 322 // Notifies how many matches have been found so far, for a given |
| 323 // identifier. |finalUpdate| specifies whether this is the last update | 323 // identifier. |finalUpdate| specifies whether this is the last update |
| 324 // (all frames have completed scoping). | 324 // (all frames have completed scoping). |
| 325 virtual void reportFindInPageMatchCount( | 325 virtual void reportFindInPageMatchCount( |
| 326 int identifier, int count, bool finalUpdate) { } | 326 int identifier, int count, bool finalUpdate) { } |
| 327 | 327 |
| 328 // Notifies what tick-mark rect is currently selected. The given | 328 // Notifies what tick-mark rect is currently selected. The given |
| 329 // identifier lets the client know which request this message belongs | 329 // identifier lets the client know which request this message belongs |
| 330 // to, so that it can choose to ignore the message if it has moved on | 330 // to, so that it can choose to ignore the message if it has moved on |
| 331 // to other things. The selection rect is expected to have coordinates | 331 // to other things. The selection rect is expected to have coordinates |
| 332 // relative to the top left corner of the web page area and represent | 332 // relative to the top left corner of the web page area and represent |
| 333 // where on the screen the selection rect is currently located. | 333 // where on the screen the selection rect is currently located. |
| 334 virtual void reportFindInPageSelection( | 334 virtual void reportFindInPageSelection( |
| 335 int identifier, int activeMatchOrdinal, const WebRect& selection) { } | 335 int identifier, int activeMatchOrdinal, const WebRect& selection) { } |
| 336 | 336 |
| 337 // Quota --------------------------------------------------------- | 337 // Quota --------------------------------------------------------- |
| 338 | 338 |
| 339 // Requests a new quota size for the origin's storage. | 339 // Requests a new quota size for the origin's storage. |
| 340 // |newQuotaInBytes| indicates how much storage space (in bytes) the | 340 // |newQuotaInBytes| indicates how much storage space (in bytes) the |
| 341 // caller expects to need. | 341 // caller expects to need. |
| 342 // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when | 342 // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when |
| 343 // a new quota is granted. WebStorageQuotaCallbacks::didFail | 343 // a new quota is granted. WebStorageQuotaCallbacks::didFail |
| 344 // is called with an error code otherwise. | 344 // is called with an error code otherwise. |
| 345 // Note that the requesting quota size may not always be granted and | 345 // Note that the requesting quota size may not always be granted and |
| 346 // a smaller amount of quota than requested might be returned. | 346 // a smaller amount of quota than requested might be returned. |
| 347 virtual void requestStorageQuota( | 347 virtual void requestStorageQuota( |
| 348 WebLocalFrame*, WebStorageQuotaType, | 348 WebFrame*, WebStorageQuotaType, |
| 349 unsigned long long newQuotaInBytes, | 349 unsigned long long newQuotaInBytes, |
| 350 WebStorageQuotaCallbacks) { } | 350 WebStorageQuotaCallbacks) { } |
| 351 | 351 |
| 352 // WebSocket ----------------------------------------------------- | 352 // WebSocket ----------------------------------------------------- |
| 353 | 353 |
| 354 // A WebSocket object is going to open new stream connection. | 354 // A WebSocket object is going to open new stream connection. |
| 355 virtual void willOpenSocketStream(WebSocketStreamHandle*) { } | 355 virtual void willOpenSocketStream(WebSocketStreamHandle*) { } |
| 356 | 356 |
| 357 // MediaStream ----------------------------------------------------- | 357 // MediaStream ----------------------------------------------------- |
| 358 | 358 |
| 359 // A new WebRTCPeerConnectionHandler is created. | 359 // A new WebRTCPeerConnectionHandler is created. |
| 360 virtual void willStartUsingPeerConnectionHandler(WebLocalFrame*, WebRTCPeerC
onnectionHandler*) { } | 360 virtual void willStartUsingPeerConnectionHandler(WebFrame*, WebRTCPeerConnec
tionHandler*) { } |
| 361 | 361 |
| 362 // Messages ------------------------------------------------------ | 362 // Messages ------------------------------------------------------ |
| 363 | 363 |
| 364 // Notifies the embedder that a postMessage was issued on this frame, and | 364 // Notifies the embedder that a postMessage was issued on this frame, and |
| 365 // gives the embedder a chance to handle it instead of WebKit. Returns true | 365 // gives the embedder a chance to handle it instead of WebKit. Returns true |
| 366 // if the embedder handled it. | 366 // if the embedder handled it. |
| 367 virtual bool willCheckAndDispatchMessageEvent( | 367 virtual bool willCheckAndDispatchMessageEvent( |
| 368 WebLocalFrame* sourceFrame, | 368 WebFrame* sourceFrame, |
| 369 WebFrame* targetFrame, | 369 WebFrame* targetFrame, |
| 370 WebSecurityOrigin target, | 370 WebSecurityOrigin target, |
| 371 WebDOMMessageEvent event) { return false; } | 371 WebDOMMessageEvent event) { return false; } |
| 372 | 372 |
| 373 // Asks the embedder if a specific user agent should be used for the given | 373 // Asks the embedder if a specific user agent should be used for the given |
| 374 // URL. Non-empty strings indicate an override should be used. Otherwise, | 374 // URL. Non-empty strings indicate an override should be used. Otherwise, |
| 375 // Platform::current()->userAgent() will be called to provide one. | 375 // Platform::current()->userAgent() will be called to provide one. |
| 376 virtual WebString userAgentOverride(WebLocalFrame*, const WebURL& url) { ret
urn WebString(); } | 376 virtual WebString userAgentOverride(WebFrame*, const WebURL& url) { return W
ebString(); } |
| 377 | 377 |
| 378 // Asks the embedder what value the network stack will send for the DNT | 378 // Asks the embedder what value the network stack will send for the DNT |
| 379 // header. An empty string indicates that no DNT header will be send. | 379 // header. An empty string indicates that no DNT header will be send. |
| 380 virtual WebString doNotTrackValue(WebLocalFrame*) { return WebString(); } | 380 virtual WebString doNotTrackValue(WebFrame*) { return WebString(); } |
| 381 | 381 |
| 382 // WebGL ------------------------------------------------------ | 382 // WebGL ------------------------------------------------------ |
| 383 | 383 |
| 384 // Asks the embedder whether WebGL is allowed for the given WebFrame. | 384 // Asks the embedder whether WebGL is allowed for the given WebFrame. |
| 385 // This call is placed here instead of WebPermissionClient because this | 385 // This call is placed here instead of WebPermissionClient because this |
| 386 // class is implemented in content/, and putting it here avoids adding | 386 // class is implemented in content/, and putting it here avoids adding |
| 387 // more public content/ APIs. | 387 // more public content/ APIs. |
| 388 virtual bool allowWebGL(WebLocalFrame*, bool defaultValue) { return defaultV
alue; } | 388 virtual bool allowWebGL(WebFrame*, bool defaultValue) { return defaultValue;
} |
| 389 | 389 |
| 390 // Notifies the client that a WebGL context was lost on this page with the | 390 // Notifies the client that a WebGL context was lost on this page with the |
| 391 // given reason (one of the GL_ARB_robustness status codes; see | 391 // given reason (one of the GL_ARB_robustness status codes; see |
| 392 // Extensions3D.h in WebCore/platform/graphics). | 392 // Extensions3D.h in WebCore/platform/graphics). |
| 393 virtual void didLoseWebGLContext(WebLocalFrame*, int) { } | 393 virtual void didLoseWebGLContext(WebFrame*, int) { } |
| 394 | 394 |
| 395 // FIXME: Remove this method once we have input routing in the browser | 395 // FIXME: Remove this method once we have input routing in the browser |
| 396 // process. See http://crbug.com/339659. | 396 // process. See http://crbug.com/339659. |
| 397 virtual void forwardInputEvent(const WebInputEvent*) { } | 397 virtual void forwardInputEvent(const WebInputEvent*) { } |
| 398 | 398 |
| 399 // Send initial drawing parameters to a child frame that is being rendered o
ut of process. | 399 // Send initial drawing parameters to a child frame that is being rendered o
ut of process. |
| 400 virtual void initializeChildFrame(const WebRect& frameRect, float scaleFacto
r) { } | 400 virtual void initializeChildFrame(const WebRect& frameRect, float scaleFacto
r) { } |
| 401 | 401 |
| 402 protected: | 402 protected: |
| 403 ~WebFrameClient() { } | 403 ~WebFrameClient() { } |
| 404 }; | 404 }; |
| 405 | 405 |
| 406 } // namespace blink | 406 } // namespace blink |
| 407 | 407 |
| 408 #endif | 408 #endif |
| OLD | NEW |