| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 5 * |
| 5 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 7 * are met: | 8 * are met: |
| 8 * | 9 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 11 * notice, this list of conditions and the following disclaimer. |
| 11 * 2. Redistributions in binary form must reproduce the above copyright | 12 * 2. Redistributions in binary form must reproduce the above copyright |
| 12 * notice, this list of conditions and the following disclaimer in the | 13 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 virtual void progressEstimateChanged(double progressEstimate) = 0; | 129 virtual void progressEstimateChanged(double progressEstimate) = 0; |
| 129 virtual void didStopLoading() = 0; | 130 virtual void didStopLoading() = 0; |
| 130 | 131 |
| 131 virtual void loadURLExternally(const ResourceRequest&, | 132 virtual void loadURLExternally(const ResourceRequest&, |
| 132 NavigationPolicy, | 133 NavigationPolicy, |
| 133 const String& suggestedName, | 134 const String& suggestedName, |
| 134 bool replacesCurrentHistoryItem) = 0; | 135 bool replacesCurrentHistoryItem) = 0; |
| 135 | 136 |
| 136 virtual bool navigateBackForward(int offset) const = 0; | 137 virtual bool navigateBackForward(int offset) const = 0; |
| 137 | 138 |
| 138 // Another page has accessed the initial empty document of this frame. | 139 // Another page has accessed the initial empty document of this frame. It is |
| 139 // It is no longer safe to display a provisional URL, since a URL spoof | 140 // no longer safe to display a provisional URL, since a URL spoof is now |
| 140 // is now possible. | 141 // possible. |
| 141 virtual void didAccessInitialDocument() {} | 142 virtual void didAccessInitialDocument() {} |
| 142 | 143 |
| 143 // This frame has displayed inactive content (such as an image) from an | 144 // This frame has displayed inactive content (such as an image) from an |
| 144 // insecure source. Inactive content cannot spread to other frames. | 145 // insecure source. Inactive content cannot spread to other frames. |
| 145 virtual void didDisplayInsecureContent() = 0; | 146 virtual void didDisplayInsecureContent() = 0; |
| 146 | 147 |
| 147 // The indicated security origin has run active content (such as a | 148 // The indicated security origin has run active content (such as a script) |
| 148 // script) from an insecure source. Note that the insecure content can | 149 // from an insecure source. Note that the insecure content can spread to |
| 149 // spread to other frames in the same origin. | 150 // other frames in the same origin. |
| 150 virtual void didRunInsecureContent(SecurityOrigin*, const KURL&) = 0; | 151 virtual void didRunInsecureContent(SecurityOrigin*, const KURL&) = 0; |
| 151 virtual void didDetectXSS(const KURL&, bool didBlockEntirePage) = 0; | 152 virtual void didDetectXSS(const KURL&, bool didBlockEntirePage) = 0; |
| 152 virtual void didDispatchPingLoader(const KURL&) = 0; | 153 virtual void didDispatchPingLoader(const KURL&) = 0; |
| 153 | 154 |
| 154 // The frame displayed content with certificate errors with given URL. | 155 // The frame displayed content with certificate errors with given URL. |
| 155 virtual void didDisplayContentWithCertificateErrors(const KURL&) = 0; | 156 virtual void didDisplayContentWithCertificateErrors(const KURL&) = 0; |
| 156 // The frame ran content with certificate errors with the given URL. | 157 // The frame ran content with certificate errors with the given URL. |
| 157 virtual void didRunContentWithCertificateErrors(const KURL&) = 0; | 158 virtual void didRunContentWithCertificateErrors(const KURL&) = 0; |
| 158 | 159 |
| 159 // Will be called when |PerformanceTiming| events are updated | 160 // Will be called when |PerformanceTiming| events are updated |
| 160 virtual void didChangePerformanceTiming() {} | 161 virtual void didChangePerformanceTiming() {} |
| 161 | 162 |
| 162 // Will be called when a particular loading code path has been used. This | 163 // Will be called when a particular loading code path has been used. This |
| 163 // propogates renderer loading behavior to the browser process for | 164 // propogates renderer loading behavior to the browser process for histograms. |
| 164 // histograms. | |
| 165 virtual void didObserveLoadingBehavior(WebLoadingBehaviorFlag) {} | 165 virtual void didObserveLoadingBehavior(WebLoadingBehaviorFlag) {} |
| 166 | 166 |
| 167 // Transmits the change in the set of watched CSS selectors property | 167 // Transmits the change in the set of watched CSS selectors property that |
| 168 // that match any element on the frame. | 168 // match any element on the frame. |
| 169 virtual void selectorMatchChanged(const Vector<String>& addedSelectors, | 169 virtual void selectorMatchChanged(const Vector<String>& addedSelectors, |
| 170 const Vector<String>& removedSelectors) = 0; | 170 const Vector<String>& removedSelectors) = 0; |
| 171 | 171 |
| 172 virtual DocumentLoader* createDocumentLoader(LocalFrame*, | 172 virtual DocumentLoader* createDocumentLoader(LocalFrame*, |
| 173 const ResourceRequest&, | 173 const ResourceRequest&, |
| 174 const SubstituteData&) = 0; | 174 const SubstituteData&) = 0; |
| 175 | 175 |
| 176 virtual String userAgent() = 0; | 176 virtual String userAgent() = 0; |
| 177 | 177 |
| 178 virtual String doNotTrackValue() = 0; | 178 virtual String doNotTrackValue() = 0; |
| 179 | 179 |
| 180 virtual void transitionToCommittedForNewPage() = 0; | 180 virtual void transitionToCommittedForNewPage() = 0; |
| 181 | 181 |
| 182 virtual LocalFrame* createFrame(const FrameLoadRequest&, | 182 virtual LocalFrame* createFrame(const FrameLoadRequest&, |
| 183 const AtomicString& name, | 183 const AtomicString& name, |
| 184 HTMLFrameOwnerElement*) = 0; | 184 HTMLFrameOwnerElement*) = 0; |
| 185 // Whether or not plugin creation should fail if the HTMLPlugInElement isn't i
n the DOM after plugin initialization. | 185 // Whether or not plugin creation should fail if the HTMLPlugInElement isn't |
| 186 // in the DOM after plugin initialization. |
| 186 enum DetachedPluginPolicy { | 187 enum DetachedPluginPolicy { |
| 187 FailOnDetachedPlugin, | 188 FailOnDetachedPlugin, |
| 188 AllowDetachedPlugin, | 189 AllowDetachedPlugin, |
| 189 }; | 190 }; |
| 190 virtual bool canCreatePluginWithoutRenderer(const String& mimeType) const = 0; | 191 virtual bool canCreatePluginWithoutRenderer(const String& mimeType) const = 0; |
| 191 virtual Widget* createPlugin(HTMLPlugInElement*, | 192 virtual Widget* createPlugin(HTMLPlugInElement*, |
| 192 const KURL&, | 193 const KURL&, |
| 193 const Vector<String>&, | 194 const Vector<String>&, |
| 194 const Vector<String>&, | 195 const Vector<String>&, |
| 195 const String&, | 196 const String&, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 return enabledPerSettings; | 240 return enabledPerSettings; |
| 240 } | 241 } |
| 241 virtual bool allowMedia(const KURL&) { return true; } | 242 virtual bool allowMedia(const KURL&) { return true; } |
| 242 virtual bool allowRunningInsecureContent(bool enabledPerSettings, | 243 virtual bool allowRunningInsecureContent(bool enabledPerSettings, |
| 243 SecurityOrigin*, | 244 SecurityOrigin*, |
| 244 const KURL&) { | 245 const KURL&) { |
| 245 return enabledPerSettings; | 246 return enabledPerSettings; |
| 246 } | 247 } |
| 247 virtual bool allowAutoplay(bool defaultValue) { return defaultValue; } | 248 virtual bool allowAutoplay(bool defaultValue) { return defaultValue; } |
| 248 | 249 |
| 249 // Reports that passive mixed content was found at the provided URL. It may | 250 // Reports that passive mixed content was found at the provided URL. It may or |
| 250 // or may not be actually displayed later, what would be flagged by | 251 // may not be actually displayed later, what would be flagged by |
| 251 // didDisplayInsecureContent. | 252 // didDisplayInsecureContent. |
| 252 virtual void passiveInsecureContentFound(const KURL&) {} | 253 virtual void passiveInsecureContentFound(const KURL&) {} |
| 253 | 254 |
| 254 // This callback notifies the client that the frame was about to run | 255 // This callback notifies the client that the frame was about to run |
| 255 // JavaScript but did not because allowScript returned false. We | 256 // JavaScript but did not because allowScript returned false. We have a |
| 256 // have a separate callback here because there are a number of places | 257 // separate callback here because there are a number of places that need to |
| 257 // that need to know if JavaScript is enabled but are not necessarily | 258 // know if JavaScript is enabled but are not necessarily preparing to execute |
| 258 // preparing to execute script. | 259 // script. |
| 259 virtual void didNotAllowScript() {} | 260 virtual void didNotAllowScript() {} |
| 260 // This callback is similar, but for plugins. | 261 // This callback is similar, but for plugins. |
| 261 virtual void didNotAllowPlugins() {} | 262 virtual void didNotAllowPlugins() {} |
| 262 | 263 |
| 263 // This callback notifies the client that the frame created a Keygen element. | 264 // This callback notifies the client that the frame created a Keygen element. |
| 264 virtual void didUseKeygen() {} | 265 virtual void didUseKeygen() {} |
| 265 | 266 |
| 266 virtual WebCookieJar* cookieJar() const = 0; | 267 virtual WebCookieJar* cookieJar() const = 0; |
| 267 | 268 |
| 268 virtual void didChangeName(const String& name, const String& uniqueName) {} | 269 virtual void didChangeName(const String& name, const String& uniqueName) {} |
| 269 | 270 |
| 270 virtual void didEnforceInsecureRequestPolicy(WebInsecureRequestPolicy) {} | 271 virtual void didEnforceInsecureRequestPolicy(WebInsecureRequestPolicy) {} |
| 271 | 272 |
| 272 virtual void didUpdateToUniqueOrigin() {} | 273 virtual void didUpdateToUniqueOrigin() {} |
| 273 | 274 |
| 274 virtual void didChangeSandboxFlags(Frame* childFrame, SandboxFlags) {} | 275 virtual void didChangeSandboxFlags(Frame* childFrame, SandboxFlags) {} |
| 275 | 276 |
| 276 // Called when a new Content Security Policy is added to the frame's | 277 // Called when a new Content Security Policy is added to the frame's document. |
| 277 // document. This can be triggered by handling of HTTP headers, handling | 278 // This can be triggered by handling of HTTP headers, handling of <meta> |
| 278 // of <meta> element, or by inheriting CSP from the parent (in case of | 279 // element, or by inheriting CSP from the parent (in case of about:blank). |
| 279 // about:blank). | |
| 280 virtual void didAddContentSecurityPolicy(const String& headerValue, | 280 virtual void didAddContentSecurityPolicy(const String& headerValue, |
| 281 ContentSecurityPolicyHeaderType, | 281 ContentSecurityPolicyHeaderType, |
| 282 ContentSecurityPolicyHeaderSource) {} | 282 ContentSecurityPolicyHeaderSource) {} |
| 283 | 283 |
| 284 virtual void didChangeFrameOwnerProperties(HTMLFrameElementBase*) {} | 284 virtual void didChangeFrameOwnerProperties(HTMLFrameElementBase*) {} |
| 285 | 285 |
| 286 virtual void dispatchWillStartUsingPeerConnectionHandler( | 286 virtual void dispatchWillStartUsingPeerConnectionHandler( |
| 287 WebRTCPeerConnectionHandler*) {} | 287 WebRTCPeerConnectionHandler*) {} |
| 288 | 288 |
| 289 virtual bool allowWebGL(bool enabledPerSettings) { | 289 virtual bool allowWebGL(bool enabledPerSettings) { |
| 290 return enabledPerSettings; | 290 return enabledPerSettings; |
| 291 } | 291 } |
| 292 | 292 |
| 293 // If an HTML document is being loaded, informs the embedder that the document
will have its <body> attached soon. | 293 // If an HTML document is being loaded, informs the embedder that the document |
| 294 // will have its <body> attached soon. |
| 294 virtual void dispatchWillInsertBody() {} | 295 virtual void dispatchWillInsertBody() {} |
| 295 | 296 |
| 296 virtual std::unique_ptr<WebServiceWorkerProvider> | 297 virtual std::unique_ptr<WebServiceWorkerProvider> |
| 297 createServiceWorkerProvider() = 0; | 298 createServiceWorkerProvider() = 0; |
| 298 | 299 |
| 299 virtual bool isControlledByServiceWorker(DocumentLoader&) = 0; | 300 virtual bool isControlledByServiceWorker(DocumentLoader&) = 0; |
| 300 | 301 |
| 301 virtual int64_t serviceWorkerID(DocumentLoader&) = 0; | 302 virtual int64_t serviceWorkerID(DocumentLoader&) = 0; |
| 302 | 303 |
| 303 virtual SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() { | 304 virtual SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() { |
| 304 return 0; | 305 return 0; |
| 305 } | 306 } |
| 306 | 307 |
| 307 virtual std::unique_ptr<WebApplicationCacheHost> createApplicationCacheHost( | 308 virtual std::unique_ptr<WebApplicationCacheHost> createApplicationCacheHost( |
| 308 WebApplicationCacheHostClient*) = 0; | 309 WebApplicationCacheHostClient*) = 0; |
| 309 | 310 |
| 310 virtual void dispatchDidChangeManifest() {} | 311 virtual void dispatchDidChangeManifest() {} |
| 311 | 312 |
| 312 virtual unsigned backForwardLength() { return 0; } | 313 virtual unsigned backForwardLength() { return 0; } |
| 313 | 314 |
| 314 virtual bool isFrameLoaderClientImpl() const { return false; } | 315 virtual bool isFrameLoaderClientImpl() const { return false; } |
| 315 | 316 |
| 316 // Called when elements preventing the sudden termination of the frame | 317 // Called when elements preventing the sudden termination of the frame become |
| 317 // become present or stop being present. |type| is the type of element | 318 // present or stop being present. |type| is the type of element (BeforeUnload |
| 318 // (BeforeUnload handler, Unload handler). | 319 // handler, Unload handler). |
| 319 enum SuddenTerminationDisablerType { | 320 enum SuddenTerminationDisablerType { |
| 320 BeforeUnloadHandler, | 321 BeforeUnloadHandler, |
| 321 UnloadHandler, | 322 UnloadHandler, |
| 322 }; | 323 }; |
| 323 virtual void suddenTerminationDisablerChanged(bool present, | 324 virtual void suddenTerminationDisablerChanged(bool present, |
| 324 SuddenTerminationDisablerType) { | 325 SuddenTerminationDisablerType) { |
| 325 } | 326 } |
| 326 | 327 |
| 327 virtual LinkResource* createServiceWorkerLinkResource(HTMLLinkElement*) { | 328 virtual LinkResource* createServiceWorkerLinkResource(HTMLLinkElement*) { |
| 328 return nullptr; | 329 return nullptr; |
| 329 } | 330 } |
| 330 | 331 |
| 331 // Effective connection type when this frame was loaded. | 332 // Effective connection type when this frame was loaded. |
| 332 virtual WebEffectiveConnectionType getEffectiveConnectionType() { | 333 virtual WebEffectiveConnectionType getEffectiveConnectionType() { |
| 333 return WebEffectiveConnectionType::TypeUnknown; | 334 return WebEffectiveConnectionType::TypeUnknown; |
| 334 } | 335 } |
| 335 | 336 |
| 336 // Overwrites the given URL to use an HTML5 embed if possible. | 337 // Overwrites the given URL to use an HTML5 embed if possible. An empty URL is |
| 337 // An empty URL is returned if the URL is not overriden. | 338 // returned if the URL is not overriden. |
| 338 virtual KURL overrideFlashEmbedWithHTML(const KURL&) { return KURL(); } | 339 virtual KURL overrideFlashEmbedWithHTML(const KURL&) { return KURL(); } |
| 339 }; | 340 }; |
| 340 | 341 |
| 341 } // namespace blink | 342 } // namespace blink |
| 342 | 343 |
| 343 #endif // FrameLoaderClient_h | 344 #endif // FrameLoaderClient_h |
| OLD | NEW |