| 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" |
| 36 #include "WebIconURL.h" | 37 #include "WebIconURL.h" |
| 37 #include "WebNavigationPolicy.h" | 38 #include "WebNavigationPolicy.h" |
| 38 #include "WebNavigationType.h" | 39 #include "WebNavigationType.h" |
| 39 #include "WebSecurityOrigin.h" | 40 #include "WebSecurityOrigin.h" |
| 40 #include "WebTextDirection.h" | 41 #include "WebTextDirection.h" |
| 41 #include "public/platform/WebCommon.h" | 42 #include "public/platform/WebCommon.h" |
| 42 #include "public/platform/WebFileSystem.h" | 43 #include "public/platform/WebFileSystem.h" |
| 43 #include "public/platform/WebFileSystemType.h" | 44 #include "public/platform/WebFileSystemType.h" |
| 44 #include "public/platform/WebStorageQuotaCallbacks.h" | 45 #include "public/platform/WebStorageQuotaCallbacks.h" |
| 45 #include "public/platform/WebStorageQuotaType.h" | 46 #include "public/platform/WebStorageQuotaType.h" |
| 46 #include "public/platform/WebURLError.h" | 47 #include "public/platform/WebURLError.h" |
| 47 #include "public/platform/WebURLRequest.h" | 48 #include "public/platform/WebURLRequest.h" |
| 48 #include <v8.h> | 49 #include <v8.h> |
| 49 | 50 |
| 50 namespace blink { | 51 namespace blink { |
| 51 | 52 |
| 52 class WebApplicationCacheHost; | 53 class WebApplicationCacheHost; |
| 53 class WebApplicationCacheHostClient; | 54 class WebApplicationCacheHostClient; |
| 54 class WebCachedURLRequest; | 55 class WebCachedURLRequest; |
| 55 class WebCookieJar; | 56 class WebCookieJar; |
| 56 class WebDataSource; | 57 class WebDataSource; |
| 57 class WebDOMEvent; | 58 class WebDOMEvent; |
| 58 class WebFormElement; | 59 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(WebFrame*, const WebPluginParams&) { return
0; } | 87 virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { re
turn 0; } |
| 88 | 88 |
| 89 // May return null. | 89 // May return null. |
| 90 virtual WebMediaPlayer* createMediaPlayer(WebFrame*, const WebURL&, WebMedia
PlayerClient*) { return 0; } | 90 virtual WebMediaPlayer* createMediaPlayer(WebLocalFrame*, const WebURL&, Web
MediaPlayerClient*) { return 0; } |
| 91 | 91 |
| 92 // May return null. | 92 // May return null. |
| 93 virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebAp
plicationCacheHostClient*) { return 0; } | 93 virtual WebApplicationCacheHost* createApplicationCacheHost(WebLocalFrame*,
WebApplicationCacheHostClient*) { 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(WebFrame*, Web
ServiceWorkerProviderClient*) { return 0; } | 97 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebLocalFrame*
, WebServiceWorkerProviderClient*) { return 0; } |
| 98 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebFrame* fram
e) { return createServiceWorkerProvider(frame, 0); } | 98 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebLocalFrame*
frame) { return createServiceWorkerProvider(frame, 0); } |
| 99 | 99 |
| 100 // May return null. | 100 // May return null. |
| 101 virtual WebWorkerPermissionClientProxy* createWorkerPermissionClientProxy(We
bFrame*) { return 0; } | 101 virtual WebWorkerPermissionClientProxy* createWorkerPermissionClientProxy(We
bLocalFrame*) { 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(WebFrame*) { return 0; } | 108 virtual WebCookieJar* cookieJar(WebLocalFrame*) { 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(WebFrame*) { } | 116 virtual void didAccessInitialDocument(WebLocalFrame*) { } |
| 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(WebFrame* parent, const WebString& frameN
ame) { return 0; } | 124 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f
rameName) { 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(WebFrame*) { } | 128 virtual void didDisownOpener(WebLocalFrame*) { } |
| 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(WebFrame*) { } | 138 virtual void willClose(WebLocalFrame*) { } |
| 139 | 139 |
| 140 // This frame's name has changed. | 140 // This frame's name has changed. |
| 141 virtual void didChangeName(WebFrame*, const WebString&) { } | 141 virtual void didChangeName(WebLocalFrame*, 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(WebFrame*, const WebVector<WebString>& newlyMatchin
gSelectors, const WebVector<WebString>& stoppedMatchingSelectors) { } | 144 virtual void didMatchCSS(WebLocalFrame*, const WebVector<WebString>& newlyMa
tchingSelectors, 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 WebFrame*, const WebURLRequest&, WebNavigationPolicy) { } | 150 WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy) { } |
| 151 virtual void loadURLExternally( | 151 virtual void loadURLExternally( |
| 152 WebFrame*, const WebURLRequest&, WebNavigationPolicy, const WebString& d
ownloadName) { } | 152 WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy, const WebStri
ng& downloadName) { } |
| 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 WebFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavigatio
nType, | 160 WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavi
gationType, |
| 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(WebFrame*, const WebFormElement&) { } | 168 virtual void willSendSubmitEvent(WebLocalFrame*, const WebFormElement&) { } |
| 169 | 169 |
| 170 // A form submission is about to occur. | 170 // A form submission is about to occur. |
| 171 virtual void willSubmitForm(WebFrame*, const WebFormElement&) { } | 171 virtual void willSubmitForm(WebLocalFrame*, 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(WebFrame*, WebDataSource*) { } | 175 virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) { } |
| 176 | 176 |
| 177 // A new provisional load has been started. | 177 // A new provisional load has been started. |
| 178 virtual void didStartProvisionalLoad(WebFrame*) { } | 178 virtual void didStartProvisionalLoad(WebLocalFrame*) { } |
| 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(WebFrame*) { } | 181 virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) { } |
| 182 | 182 |
| 183 // The provisional load failed. | 183 // The provisional load failed. |
| 184 virtual void didFailProvisionalLoad(WebFrame*, const WebURLError&) { } | 184 virtual void didFailProvisionalLoad(WebLocalFrame*, 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(WebFrame*, bool isNewNavigation) { } | 189 virtual void didCommitProvisionalLoad(WebLocalFrame*, 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(WebFrame* frame, int worldId) { } | 194 virtual void didClearWindowObject(WebLocalFrame* frame, int worldId) { } |
| 195 | 195 |
| 196 // The document element has been created. | 196 // The document element has been created. |
| 197 virtual void didCreateDocumentElement(WebFrame*) { } | 197 virtual void didCreateDocumentElement(WebLocalFrame*) { } |
| 198 | 198 |
| 199 // The page title is available. | 199 // The page title is available. |
| 200 virtual void didReceiveTitle(WebFrame* frame, const WebString& title, WebTex
tDirection direction) { } | 200 virtual void didReceiveTitle(WebLocalFrame* frame, const WebString& title, W
ebTextDirection direction) { } |
| 201 | 201 |
| 202 // The icon for the page have changed. | 202 // The icon for the page have changed. |
| 203 virtual void didChangeIcon(WebFrame*, WebIconURL::Type) { } | 203 virtual void didChangeIcon(WebLocalFrame*, WebIconURL::Type) { } |
| 204 | 204 |
| 205 // The frame's document finished loading. | 205 // The frame's document finished loading. |
| 206 virtual void didFinishDocumentLoad(WebFrame*) { } | 206 virtual void didFinishDocumentLoad(WebLocalFrame*) { } |
| 207 | 207 |
| 208 // The 'load' event was dispatched. | 208 // The 'load' event was dispatched. |
| 209 virtual void didHandleOnloadEvents(WebFrame*) { } | 209 virtual void didHandleOnloadEvents(WebLocalFrame*) { } |
| 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(WebFrame*, const WebURLError&) { } | 212 virtual void didFailLoad(WebLocalFrame*, 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(WebFrame*) { } | 215 virtual void didFinishLoad(WebLocalFrame*) { } |
| 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(WebFrame*, bool isNewNavigation) { } | 220 virtual void didNavigateWithinPage(WebLocalFrame*, 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(WebFrame*) { } | 225 virtual void didUpdateCurrentHistoryItem(WebLocalFrame*) { } |
| 226 | 226 |
| 227 | 227 |
| 228 // UI ------------------------------------------------------------------ | 228 // UI ------------------------------------------------------------------ |
| 229 | 229 |
| 230 // Shows a context menu with commands relevant to a specific element on | 230 // Shows a context menu with commands relevant to a specific element on |
| 231 // the given frame. Additional context data is supplied. | 231 // the given frame. Additional context data is supplied. |
| 232 virtual void showContextMenu(const WebContextMenuData&) { } | 232 virtual void showContextMenu(const WebContextMenuData&) { } |
| 233 | 233 |
| 234 // Called when the data attached to the currently displayed context menu is | 234 // Called when the data attached to the currently displayed context menu is |
| 235 // invalidated. The context menu may be closed if possible. | 235 // invalidated. The context menu may be closed if possible. |
| 236 virtual void clearContextMenu() { } | 236 virtual void clearContextMenu() { } |
| 237 | 237 |
| 238 | 238 |
| 239 // Low-level resource notifications ------------------------------------ | 239 // Low-level resource notifications ------------------------------------ |
| 240 | 240 |
| 241 // An element will request a resource. | 241 // An element will request a resource. |
| 242 virtual void willRequestResource(WebFrame*, const WebCachedURLRequest&) { } | 242 virtual void willRequestResource(WebLocalFrame*, const WebCachedURLRequest&)
{ } |
| 243 | 243 |
| 244 // The request is after preconnect is triggered. | 244 // The request is after preconnect is triggered. |
| 245 virtual void willRequestAfterPreconnect(WebFrame*, WebURLRequest&) { } | 245 virtual void willRequestAfterPreconnect(WebLocalFrame*, WebURLRequest&) { } |
| 246 | 246 |
| 247 // A request is about to be sent out, and the client may modify it. Request | 247 // A request is about to be sent out, and the client may modify it. Request |
| 248 // is writable, and changes to the URL, for example, will change the request | 248 // is writable, and changes to the URL, for example, will change the request |
| 249 // made. If this request is the result of a redirect, then redirectResponse | 249 // made. If this request is the result of a redirect, then redirectResponse |
| 250 // will be non-null and contain the response that triggered the redirect. | 250 // will be non-null and contain the response that triggered the redirect. |
| 251 virtual void willSendRequest( | 251 virtual void willSendRequest( |
| 252 WebFrame*, unsigned identifier, WebURLRequest&, | 252 WebLocalFrame*, unsigned identifier, WebURLRequest&, |
| 253 const WebURLResponse& redirectResponse) { } | 253 const WebURLResponse& redirectResponse) { } |
| 254 | 254 |
| 255 // Response headers have been received for the resource request given | 255 // Response headers have been received for the resource request given |
| 256 // by identifier. | 256 // by identifier. |
| 257 virtual void didReceiveResponse( | 257 virtual void didReceiveResponse( |
| 258 WebFrame*, unsigned identifier, const WebURLResponse&) { } | 258 WebLocalFrame*, unsigned identifier, const WebURLResponse&) { } |
| 259 | 259 |
| 260 virtual void didChangeResourcePriority( | 260 virtual void didChangeResourcePriority( |
| 261 WebFrame*, unsigned identifier, const blink::WebURLRequest::Priority&) {
} | 261 WebLocalFrame*, unsigned identifier, const blink::WebURLRequest::Priorit
y&) { } |
| 262 | 262 |
| 263 // The resource request given by identifier succeeded. | 263 // The resource request given by identifier succeeded. |
| 264 virtual void didFinishResourceLoad( | 264 virtual void didFinishResourceLoad( |
| 265 WebFrame*, unsigned identifier) { } | 265 WebLocalFrame*, unsigned identifier) { } |
| 266 | 266 |
| 267 // The specified request was satified from WebCore's memory cache. | 267 // The specified request was satified from WebCore's memory cache. |
| 268 virtual void didLoadResourceFromMemoryCache( | 268 virtual void didLoadResourceFromMemoryCache( |
| 269 WebFrame*, const WebURLRequest&, const WebURLResponse&) { } | 269 WebLocalFrame*, const WebURLRequest&, const WebURLResponse&) { } |
| 270 | 270 |
| 271 // This frame has displayed inactive content (such as an image) from an | 271 // This frame has displayed inactive content (such as an image) from an |
| 272 // insecure source. Inactive content cannot spread to other frames. | 272 // insecure source. Inactive content cannot spread to other frames. |
| 273 virtual void didDisplayInsecureContent(WebFrame*) { } | 273 virtual void didDisplayInsecureContent(WebLocalFrame*) { } |
| 274 | 274 |
| 275 // The indicated security origin has run active content (such as a | 275 // The indicated security origin has run active content (such as a |
| 276 // script) from an insecure source. Note that the insecure content can | 276 // script) from an insecure source. Note that the insecure content can |
| 277 // spread to other frames in the same origin. | 277 // spread to other frames in the same origin. |
| 278 virtual void didRunInsecureContent(WebFrame*, const WebSecurityOrigin&, cons
t WebURL& insecureURL) { } | 278 virtual void didRunInsecureContent(WebLocalFrame*, const WebSecurityOrigin&,
const WebURL& insecureURL) { } |
| 279 | 279 |
| 280 // A reflected XSS was encountered in the page and suppressed. | 280 // A reflected XSS was encountered in the page and suppressed. |
| 281 virtual void didDetectXSS(WebFrame*, const WebURL&, bool didBlockEntirePage)
{ } | 281 virtual void didDetectXSS(WebLocalFrame*, const WebURL&, bool didBlockEntire
Page) { } |
| 282 | 282 |
| 283 // A PingLoader was created, and a request dispatched to a URL. | 283 // A PingLoader was created, and a request dispatched to a URL. |
| 284 virtual void didDispatchPingLoader(WebFrame*, const WebURL&) { } | 284 virtual void didDispatchPingLoader(WebLocalFrame*, const WebURL&) { } |
| 285 | 285 |
| 286 // The loaders in this frame have been stopped. | 286 // The loaders in this frame have been stopped. |
| 287 virtual void didAbortLoading(WebFrame*) { } | 287 virtual void didAbortLoading(WebLocalFrame*) { } |
| 288 | 288 |
| 289 // Script notifications ------------------------------------------------ | 289 // Script notifications ------------------------------------------------ |
| 290 | 290 |
| 291 // Notifies that a new script context has been created for this frame. | 291 // Notifies that a new script context has been created for this frame. |
| 292 // This is similar to didClearWindowObject but only called once per | 292 // This is similar to didClearWindowObject but only called once per |
| 293 // frame context. | 293 // frame context. |
| 294 virtual void didCreateScriptContext(WebFrame*, v8::Handle<v8::Context>, int
extensionGroup, int worldId) { } | 294 virtual void didCreateScriptContext(WebLocalFrame*, v8::Handle<v8::Context>,
int extensionGroup, int worldId) { } |
| 295 | 295 |
| 296 // WebKit is about to release its reference to a v8 context for a frame. | 296 // WebKit is about to release its reference to a v8 context for a frame. |
| 297 virtual void willReleaseScriptContext(WebFrame*, v8::Handle<v8::Context>, in
t worldId) { } | 297 virtual void willReleaseScriptContext(WebLocalFrame*, v8::Handle<v8::Context
>, int worldId) { } |
| 298 | 298 |
| 299 // Geometry notifications ---------------------------------------------- | 299 // Geometry notifications ---------------------------------------------- |
| 300 | 300 |
| 301 // The frame's document finished the initial non-empty layout of a page. | 301 // The frame's document finished the initial non-empty layout of a page. |
| 302 virtual void didFirstVisuallyNonEmptyLayout(WebFrame*) { } | 302 virtual void didFirstVisuallyNonEmptyLayout(WebLocalFrame*) { } |
| 303 | 303 |
| 304 // The size of the content area changed. | 304 // The size of the content area changed. |
| 305 virtual void didChangeContentsSize(WebFrame*, const WebSize&) { } | 305 virtual void didChangeContentsSize(WebLocalFrame*, const WebSize&) { } |
| 306 | 306 |
| 307 // The main frame scrolled. | 307 // The main frame scrolled. |
| 308 virtual void didChangeScrollOffset(WebFrame*) { } | 308 virtual void didChangeScrollOffset(WebLocalFrame*) { } |
| 309 | 309 |
| 310 // If the frame is loading an HTML document, this will be called to | 310 // If the frame is loading an HTML document, this will be called to |
| 311 // notify that the <body> will be attached soon. | 311 // notify that the <body> will be attached soon. |
| 312 virtual void willInsertBody(WebFrame*) { } | 312 virtual void willInsertBody(WebLocalFrame*) { } |
| 313 | 313 |
| 314 // Find-in-page notifications ------------------------------------------ | 314 // Find-in-page notifications ------------------------------------------ |
| 315 | 315 |
| 316 // Notifies how many matches have been found so far, for a given | 316 // Notifies how many matches have been found so far, for a given |
| 317 // identifier. |finalUpdate| specifies whether this is the last update | 317 // identifier. |finalUpdate| specifies whether this is the last update |
| 318 // (all frames have completed scoping). | 318 // (all frames have completed scoping). |
| 319 virtual void reportFindInPageMatchCount( | 319 virtual void reportFindInPageMatchCount( |
| 320 int identifier, int count, bool finalUpdate) { } | 320 int identifier, int count, bool finalUpdate) { } |
| 321 | 321 |
| 322 // Notifies what tick-mark rect is currently selected. The given | 322 // Notifies what tick-mark rect is currently selected. The given |
| 323 // identifier lets the client know which request this message belongs | 323 // identifier lets the client know which request this message belongs |
| 324 // to, so that it can choose to ignore the message if it has moved on | 324 // to, so that it can choose to ignore the message if it has moved on |
| 325 // to other things. The selection rect is expected to have coordinates | 325 // to other things. The selection rect is expected to have coordinates |
| 326 // relative to the top left corner of the web page area and represent | 326 // relative to the top left corner of the web page area and represent |
| 327 // where on the screen the selection rect is currently located. | 327 // where on the screen the selection rect is currently located. |
| 328 virtual void reportFindInPageSelection( | 328 virtual void reportFindInPageSelection( |
| 329 int identifier, int activeMatchOrdinal, const WebRect& selection) { } | 329 int identifier, int activeMatchOrdinal, const WebRect& selection) { } |
| 330 | 330 |
| 331 // Quota --------------------------------------------------------- | 331 // Quota --------------------------------------------------------- |
| 332 | 332 |
| 333 // Requests a new quota size for the origin's storage. | 333 // Requests a new quota size for the origin's storage. |
| 334 // |newQuotaInBytes| indicates how much storage space (in bytes) the | 334 // |newQuotaInBytes| indicates how much storage space (in bytes) the |
| 335 // caller expects to need. | 335 // caller expects to need. |
| 336 // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when | 336 // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when |
| 337 // a new quota is granted. WebStorageQuotaCallbacks::didFail | 337 // a new quota is granted. WebStorageQuotaCallbacks::didFail |
| 338 // is called with an error code otherwise. | 338 // is called with an error code otherwise. |
| 339 // Note that the requesting quota size may not always be granted and | 339 // Note that the requesting quota size may not always be granted and |
| 340 // a smaller amount of quota than requested might be returned. | 340 // a smaller amount of quota than requested might be returned. |
| 341 virtual void requestStorageQuota( | 341 virtual void requestStorageQuota( |
| 342 WebFrame*, WebStorageQuotaType, | 342 WebLocalFrame*, WebStorageQuotaType, |
| 343 unsigned long long newQuotaInBytes, | 343 unsigned long long newQuotaInBytes, |
| 344 WebStorageQuotaCallbacks) { } | 344 WebStorageQuotaCallbacks) { } |
| 345 | 345 |
| 346 // WebSocket ----------------------------------------------------- | 346 // WebSocket ----------------------------------------------------- |
| 347 | 347 |
| 348 // A WebSocket object is going to open new stream connection. | 348 // A WebSocket object is going to open new stream connection. |
| 349 virtual void willOpenSocketStream(WebSocketStreamHandle*) { } | 349 virtual void willOpenSocketStream(WebSocketStreamHandle*) { } |
| 350 | 350 |
| 351 // MediaStream ----------------------------------------------------- | 351 // MediaStream ----------------------------------------------------- |
| 352 | 352 |
| 353 // A new WebRTCPeerConnectionHandler is created. | 353 // A new WebRTCPeerConnectionHandler is created. |
| 354 virtual void willStartUsingPeerConnectionHandler(WebFrame*, WebRTCPeerConnec
tionHandler*) { } | 354 virtual void willStartUsingPeerConnectionHandler(WebLocalFrame*, WebRTCPeerC
onnectionHandler*) { } |
| 355 | 355 |
| 356 // Messages ------------------------------------------------------ | 356 // Messages ------------------------------------------------------ |
| 357 | 357 |
| 358 // Notifies the embedder that a postMessage was issued on this frame, and | 358 // Notifies the embedder that a postMessage was issued on this frame, and |
| 359 // gives the embedder a chance to handle it instead of WebKit. Returns true | 359 // gives the embedder a chance to handle it instead of WebKit. Returns true |
| 360 // if the embedder handled it. | 360 // if the embedder handled it. |
| 361 virtual bool willCheckAndDispatchMessageEvent( | 361 virtual bool willCheckAndDispatchMessageEvent( |
| 362 WebFrame* sourceFrame, | 362 WebLocalFrame* sourceFrame, |
| 363 WebFrame* targetFrame, | 363 WebFrame* targetFrame, |
| 364 WebSecurityOrigin target, | 364 WebSecurityOrigin target, |
| 365 WebDOMMessageEvent event) { return false; } | 365 WebDOMMessageEvent event) { return false; } |
| 366 | 366 |
| 367 // Asks the embedder if a specific user agent should be used for the given | 367 // Asks the embedder if a specific user agent should be used for the given |
| 368 // URL. Non-empty strings indicate an override should be used. Otherwise, | 368 // URL. Non-empty strings indicate an override should be used. Otherwise, |
| 369 // Platform::current()->userAgent() will be called to provide one. | 369 // Platform::current()->userAgent() will be called to provide one. |
| 370 virtual WebString userAgentOverride(WebFrame*, const WebURL& url) { return W
ebString(); } | 370 virtual WebString userAgentOverride(WebLocalFrame*, const WebURL& url) { ret
urn WebString(); } |
| 371 | 371 |
| 372 // Asks the embedder what value the network stack will send for the DNT | 372 // Asks the embedder what value the network stack will send for the DNT |
| 373 // header. An empty string indicates that no DNT header will be send. | 373 // header. An empty string indicates that no DNT header will be send. |
| 374 virtual WebString doNotTrackValue(WebFrame*) { return WebString(); } | 374 virtual WebString doNotTrackValue(WebLocalFrame*) { return WebString(); } |
| 375 | 375 |
| 376 // WebGL ------------------------------------------------------ | 376 // WebGL ------------------------------------------------------ |
| 377 | 377 |
| 378 // Asks the embedder whether WebGL is allowed for the given WebFrame. | 378 // Asks the embedder whether WebGL is allowed for the given WebFrame. |
| 379 // This call is placed here instead of WebPermissionClient because this | 379 // This call is placed here instead of WebPermissionClient because this |
| 380 // class is implemented in content/, and putting it here avoids adding | 380 // class is implemented in content/, and putting it here avoids adding |
| 381 // more public content/ APIs. | 381 // more public content/ APIs. |
| 382 virtual bool allowWebGL(WebFrame*, bool defaultValue) { return defaultValue;
} | 382 virtual bool allowWebGL(WebLocalFrame*, bool defaultValue) { return defaultV
alue; } |
| 383 | 383 |
| 384 // Notifies the client that a WebGL context was lost on this page with the | 384 // Notifies the client that a WebGL context was lost on this page with the |
| 385 // given reason (one of the GL_ARB_robustness status codes; see | 385 // given reason (one of the GL_ARB_robustness status codes; see |
| 386 // Extensions3D.h in WebCore/platform/graphics). | 386 // Extensions3D.h in WebCore/platform/graphics). |
| 387 virtual void didLoseWebGLContext(WebFrame*, int) { } | 387 virtual void didLoseWebGLContext(WebLocalFrame*, int) { } |
| 388 | 388 |
| 389 // FIXME: Remove this method once we have input routing in the browser | 389 // FIXME: Remove this method once we have input routing in the browser |
| 390 // process. See http://crbug.com/339659. | 390 // process. See http://crbug.com/339659. |
| 391 virtual void forwardInputEvent(const WebInputEvent*) { } | 391 virtual void forwardInputEvent(const WebInputEvent*) { } |
| 392 | 392 |
| 393 // Send initial drawing parameters to a child frame that is being rendered o
ut of process. | 393 // Send initial drawing parameters to a child frame that is being rendered o
ut of process. |
| 394 virtual void initializeChildFrame(const WebRect& frameRect, float scaleFacto
r) { } | 394 virtual void initializeChildFrame(const WebRect& frameRect, float scaleFacto
r) { } |
| 395 | 395 |
| 396 protected: | 396 protected: |
| 397 ~WebFrameClient() { } | 397 ~WebFrameClient() { } |
| 398 }; | 398 }; |
| 399 | 399 |
| 400 } // namespace blink | 400 } // namespace blink |
| 401 | 401 |
| 402 #endif | 402 #endif |
| OLD | NEW |