Chromium Code Reviews| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 class WebContentDecryptionModule; | 76 class WebContentDecryptionModule; |
| 77 class WebCookieJar; | 77 class WebCookieJar; |
| 78 class WebCString; | 78 class WebCString; |
| 79 class WebDataSource; | 79 class WebDataSource; |
| 80 class WebEncryptedMediaClient; | 80 class WebEncryptedMediaClient; |
| 81 class WebExternalPopupMenu; | 81 class WebExternalPopupMenu; |
| 82 class WebExternalPopupMenuClient; | 82 class WebExternalPopupMenuClient; |
| 83 class WebFileChooserCompletion; | 83 class WebFileChooserCompletion; |
| 84 class WebFormElement; | 84 class WebFormElement; |
| 85 class WebInstalledAppClient; | 85 class WebInstalledAppClient; |
| 86 class WebLocalFrame; | |
| 86 class WebMediaPlayer; | 87 class WebMediaPlayer; |
| 87 class WebMediaPlayerClient; | 88 class WebMediaPlayerClient; |
| 88 class WebMediaPlayerEncryptedMediaClient; | 89 class WebMediaPlayerEncryptedMediaClient; |
| 89 class WebMediaPlayerSource; | 90 class WebMediaPlayerSource; |
| 90 class WebMediaSession; | 91 class WebMediaSession; |
| 91 class WebMediaStream; | 92 class WebMediaStream; |
| 92 class WebServiceWorkerProvider; | 93 class WebServiceWorkerProvider; |
| 93 class WebPlugin; | 94 class WebPlugin; |
| 94 class WebPresentationClient; | 95 class WebPresentationClient; |
| 95 class WebPushClient; | 96 class WebPushClient; |
| 96 class WebRTCPeerConnectionHandler; | 97 class WebRTCPeerConnectionHandler; |
| 97 class WebScreenOrientationClient; | 98 class WebScreenOrientationClient; |
| 98 class WebString; | 99 class WebString; |
| 99 class WebURL; | 100 class WebURL; |
| 100 class WebURLResponse; | 101 class WebURLResponse; |
| 101 class WebUserMediaClient; | 102 class WebUserMediaClient; |
| 102 class WebWorkerContentSettingsClientProxy; | 103 class WebWorkerContentSettingsClientProxy; |
| 103 struct WebColorSuggestion; | 104 struct WebColorSuggestion; |
| 104 struct WebConsoleMessage; | 105 struct WebConsoleMessage; |
| 105 struct WebContextMenuData; | 106 struct WebContextMenuData; |
| 106 struct WebPluginParams; | 107 struct WebPluginParams; |
| 107 struct WebPopupMenuInfo; | 108 struct WebPopupMenuInfo; |
| 108 struct WebRect; | 109 struct WebRect; |
| 109 struct WebURLError; | 110 struct WebURLError; |
| 110 | 111 |
| 111 class WebFrameClient { | 112 class BLINK_EXPORT WebFrameClient { |
| 112 public: | 113 public: |
| 114 virtual ~WebFrameClient() {} | |
|
dcheng
2016/09/29 04:13:28
I'm not sure how I feel about making this public,
| |
| 115 | |
| 113 // Factory methods ----------------------------------------------------- | 116 // Factory methods ----------------------------------------------------- |
| 114 | 117 |
| 115 // May return null. | 118 // May return null. |
| 116 virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { re turn 0; } | 119 virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { re turn 0; } |
| 117 | 120 |
| 118 // May return null. | 121 // May return null. |
| 119 // WebContentDecryptionModule* may be null if one has not yet been set. | 122 // WebContentDecryptionModule* may be null if one has not yet been set. |
| 120 virtual WebMediaPlayer* createMediaPlayer(const WebMediaPlayerSource&, WebMe diaPlayerClient*, WebMediaPlayerEncryptedMediaClient*, WebContentDecryptionModul e*, const WebString& sinkId) { return 0; } | 123 virtual WebMediaPlayer* createMediaPlayer(const WebMediaPlayerSource&, WebMe diaPlayerClient*, WebMediaPlayerEncryptedMediaClient*, WebContentDecryptionModul e*, const WebString& sinkId) { return 0; } |
| 121 | 124 |
| 122 // May return null. | 125 // May return null. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 149 // General notifications ----------------------------------------------- | 152 // General notifications ----------------------------------------------- |
| 150 | 153 |
| 151 // Indicates if creating a plugin without an associated renderer is supporte d. | 154 // Indicates if creating a plugin without an associated renderer is supporte d. |
| 152 virtual bool canCreatePluginWithoutRenderer(const WebString& mimeType) { ret urn false; } | 155 virtual bool canCreatePluginWithoutRenderer(const WebString& mimeType) { ret urn false; } |
| 153 | 156 |
| 154 // Indicates that another page has accessed the DOM of the initial empty | 157 // Indicates that another page has accessed the DOM of the initial empty |
| 155 // document of a main frame. After this, it is no longer safe to show a | 158 // document of a main frame. After this, it is no longer safe to show a |
| 156 // pending navigation's URL, because a URL spoof is possible. | 159 // pending navigation's URL, because a URL spoof is possible. |
| 157 virtual void didAccessInitialDocument() { } | 160 virtual void didAccessInitialDocument() { } |
| 158 | 161 |
| 159 // A child frame was created in this frame. This is called when the frame | 162 // Request the creation of a new child frame. Embedders may return nullptr |
| 160 // is created and initialized. Takes the name of the new frame, the parent | 163 // to prevent the new child frame from being attached. Otherwise, embedders |
| 161 // frame and returns a new WebFrame. The WebFrame is considered in-use | 164 // should create a new WebLocalFrame, insert it into the frame tree, and |
| 162 // until frameDetached() is called on it. | 165 // return the created frame. |
| 163 // Note: If you override this, you should almost certainly be overriding | 166 virtual WebLocalFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeT ype, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandbox Flags, const WebFrameOwnerProperties&) { return nullptr; } |
|
dcheng
2016/09/29 04:13:28
Changed the return type since all child frames sta
| |
| 164 // frameDetached(). | |
| 165 virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags , const WebFrameOwnerProperties&) { return nullptr; } | |
| 166 | 167 |
| 167 // This frame has set its opener to another frame, or disowned the opener | 168 // This frame has set its opener to another frame, or disowned the opener |
| 168 // if opener is null. See http://html.spec.whatwg.org/#dom-opener. | 169 // if opener is null. See http://html.spec.whatwg.org/#dom-opener. |
| 169 virtual void didChangeOpener(WebFrame*) { } | 170 virtual void didChangeOpener(WebFrame*) { } |
| 170 | 171 |
| 171 // Specifies the reason for the detachment. | 172 // Specifies the reason for the detachment. |
| 172 enum class DetachType { Remove, Swap }; | 173 enum class DetachType { Remove, Swap }; |
| 173 | 174 |
| 174 // This frame has been detached from the view, but has not been closed yet. | 175 // This frame has been detached. Embedders should release any resources |
| 175 virtual void frameDetached(WebLocalFrame*, DetachType) {} | 176 // associated with this frame. If the DetachType is Remove, the frame should |
| 177 // also be removed from the frame tree; otherwise, if the DetachType is | |
| 178 // Swap, the frame is being replaced in-place by WebFrame::swap(). | |
| 179 virtual void frameDetached(WebLocalFrame*, DetachType); | |
|
dcheng
2016/09/29 04:13:28
I gave this a default implementation to avoid a bu
| |
| 176 | 180 |
| 177 // This frame has become focused.. | 181 // This frame has become focused. |
| 178 virtual void frameFocused() { } | 182 virtual void frameFocused() { } |
| 179 | 183 |
| 180 // This frame is about to be closed. This is called after frameDetached, | 184 // A provisional load is about to commit. |
| 181 // when the document is being unloaded, due to new one committing. | 185 virtual void willCommitProvisionalLoad(WebLocalFrame*) {} |
|
dcheng
2016/09/29 04:13:27
I'm not sure how willClose() ended up meaning this
| |
| 182 virtual void willClose(WebFrame*) { } | |
| 183 | 186 |
| 184 // This frame's name has changed. | 187 // This frame's name has changed. |
| 185 virtual void didChangeName(const WebString& name, const WebString& uniqueNam e) { } | 188 virtual void didChangeName(const WebString& name, const WebString& uniqueNam e) { } |
| 186 | 189 |
| 187 // This frame has set an insecure request policy. | 190 // This frame has set an insecure request policy. |
| 188 virtual void didEnforceInsecureRequestPolicy(WebInsecureRequestPolicy) {} | 191 virtual void didEnforceInsecureRequestPolicy(WebInsecureRequestPolicy) {} |
| 189 | 192 |
| 190 // This frame has been updated to a unique origin, which should be | 193 // This frame has been updated to a unique origin, which should be |
| 191 // considered potentially trustworthy if | 194 // considered potentially trustworthy if |
| 192 // |isPotentiallyTrustworthyUniqueOrigin| is true. TODO(estark): | 195 // |isPotentiallyTrustworthyUniqueOrigin| is true. TODO(estark): |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 686 { | 689 { |
| 687 return WebPageVisibilityStateVisible; | 690 return WebPageVisibilityStateVisible; |
| 688 } | 691 } |
| 689 | 692 |
| 690 // Overwrites the given URL to use an HTML5 embed if possible. | 693 // Overwrites the given URL to use an HTML5 embed if possible. |
| 691 // An empty URL is returned if the URL is not overriden. | 694 // An empty URL is returned if the URL is not overriden. |
| 692 virtual WebURL overrideFlashEmbedWithHTML(const WebURL& url) | 695 virtual WebURL overrideFlashEmbedWithHTML(const WebURL& url) |
| 693 { | 696 { |
| 694 return WebURL(); | 697 return WebURL(); |
| 695 } | 698 } |
| 696 | |
| 697 protected: | |
| 698 virtual ~WebFrameClient() { } | |
| 699 }; | 699 }; |
| 700 | 700 |
| 701 } // namespace blink | 701 } // namespace blink |
| 702 | 702 |
| 703 #endif | 703 #endif |
| OLD | NEW |