Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: third_party/WebKit/public/web/WebFrameClient.h

Issue 2389493002: Revert of Require WebLocalFrame to be created with a non-null client (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
87 class WebMediaPlayer; 86 class WebMediaPlayer;
88 class WebMediaPlayerClient; 87 class WebMediaPlayerClient;
89 class WebMediaPlayerEncryptedMediaClient; 88 class WebMediaPlayerEncryptedMediaClient;
90 class WebMediaPlayerSource; 89 class WebMediaPlayerSource;
91 class WebMediaSession; 90 class WebMediaSession;
92 class WebMediaStream; 91 class WebMediaStream;
93 class WebServiceWorkerProvider; 92 class WebServiceWorkerProvider;
94 class WebPlugin; 93 class WebPlugin;
95 class WebPresentationClient; 94 class WebPresentationClient;
96 class WebPushClient; 95 class WebPushClient;
97 class WebRTCPeerConnectionHandler; 96 class WebRTCPeerConnectionHandler;
98 class WebScreenOrientationClient; 97 class WebScreenOrientationClient;
99 class WebString; 98 class WebString;
100 class WebURL; 99 class WebURL;
101 class WebURLResponse; 100 class WebURLResponse;
102 class WebUserMediaClient; 101 class WebUserMediaClient;
103 class WebWorkerContentSettingsClientProxy; 102 class WebWorkerContentSettingsClientProxy;
104 struct WebColorSuggestion; 103 struct WebColorSuggestion;
105 struct WebConsoleMessage; 104 struct WebConsoleMessage;
106 struct WebContextMenuData; 105 struct WebContextMenuData;
107 struct WebPluginParams; 106 struct WebPluginParams;
108 struct WebPopupMenuInfo; 107 struct WebPopupMenuInfo;
109 struct WebRect; 108 struct WebRect;
110 struct WebURLError; 109 struct WebURLError;
111 110
112 class BLINK_EXPORT WebFrameClient { 111 class WebFrameClient {
113 public: 112 public:
114 virtual ~WebFrameClient() {}
115
116 // Factory methods ----------------------------------------------------- 113 // Factory methods -----------------------------------------------------
117 114
118 // May return null. 115 // May return null.
119 virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { re turn 0; } 116 virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { re turn 0; }
120 117
121 // May return null. 118 // May return null.
122 // WebContentDecryptionModule* may be null if one has not yet been set. 119 // WebContentDecryptionModule* may be null if one has not yet been set.
123 virtual WebMediaPlayer* createMediaPlayer(const WebMediaPlayerSource&, WebMe diaPlayerClient*, WebMediaPlayerEncryptedMediaClient*, WebContentDecryptionModul e*, const WebString& sinkId) { return 0; } 120 virtual WebMediaPlayer* createMediaPlayer(const WebMediaPlayerSource&, WebMe diaPlayerClient*, WebMediaPlayerEncryptedMediaClient*, WebContentDecryptionModul e*, const WebString& sinkId) { return 0; }
124 121
125 // May return null. 122 // May return null.
(...skipping 26 matching lines...) Expand all
152 // General notifications ----------------------------------------------- 149 // General notifications -----------------------------------------------
153 150
154 // Indicates if creating a plugin without an associated renderer is supporte d. 151 // Indicates if creating a plugin without an associated renderer is supporte d.
155 virtual bool canCreatePluginWithoutRenderer(const WebString& mimeType) { ret urn false; } 152 virtual bool canCreatePluginWithoutRenderer(const WebString& mimeType) { ret urn false; }
156 153
157 // Indicates that another page has accessed the DOM of the initial empty 154 // Indicates that another page has accessed the DOM of the initial empty
158 // document of a main frame. After this, it is no longer safe to show a 155 // document of a main frame. After this, it is no longer safe to show a
159 // pending navigation's URL, because a URL spoof is possible. 156 // pending navigation's URL, because a URL spoof is possible.
160 virtual void didAccessInitialDocument() { } 157 virtual void didAccessInitialDocument() { }
161 158
162 // Request the creation of a new child frame. Embedders may return nullptr 159 // A child frame was created in this frame. This is called when the frame
163 // to prevent the new child frame from being attached. Otherwise, embedders 160 // is created and initialized. Takes the name of the new frame, the parent
164 // should create a new WebLocalFrame, insert it into the frame tree, and 161 // frame and returns a new WebFrame. The WebFrame is considered in-use
165 // return the created frame. 162 // until frameDetached() is called on it.
166 virtual WebLocalFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeT ype, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandbox Flags, const WebFrameOwnerProperties&) { return nullptr; } 163 // Note: If you override this, you should almost certainly be overriding
164 // frameDetached().
165 virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags , const WebFrameOwnerProperties&) { return nullptr; }
167 166
168 // This frame has set its opener to another frame, or disowned the opener 167 // This frame has set its opener to another frame, or disowned the opener
169 // if opener is null. See http://html.spec.whatwg.org/#dom-opener. 168 // if opener is null. See http://html.spec.whatwg.org/#dom-opener.
170 virtual void didChangeOpener(WebFrame*) { } 169 virtual void didChangeOpener(WebFrame*) { }
171 170
172 // Specifies the reason for the detachment. 171 // Specifies the reason for the detachment.
173 enum class DetachType { Remove, Swap }; 172 enum class DetachType { Remove, Swap };
174 173
175 // This frame has been detached. Embedders should release any resources 174 // This frame has been detached from the view, but has not been closed yet.
176 // associated with this frame. If the DetachType is Remove, the frame should 175 virtual void frameDetached(WebLocalFrame*, DetachType) {}
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);
180 176
181 // This frame has become focused. 177 // This frame has become focused..
182 virtual void frameFocused() { } 178 virtual void frameFocused() { }
183 179
184 // A provisional load is about to commit. 180 // This frame is about to be closed. This is called after frameDetached,
185 virtual void willCommitProvisionalLoad(WebLocalFrame*) {} 181 // when the document is being unloaded, due to new one committing.
182 virtual void willClose(WebFrame*) { }
186 183
187 // This frame's name has changed. 184 // This frame's name has changed.
188 virtual void didChangeName(const WebString& name, const WebString& uniqueNam e) { } 185 virtual void didChangeName(const WebString& name, const WebString& uniqueNam e) { }
189 186
190 // This frame has set an insecure request policy. 187 // This frame has set an insecure request policy.
191 virtual void didEnforceInsecureRequestPolicy(WebInsecureRequestPolicy) {} 188 virtual void didEnforceInsecureRequestPolicy(WebInsecureRequestPolicy) {}
192 189
193 // This frame has been updated to a unique origin, which should be 190 // This frame has been updated to a unique origin, which should be
194 // considered potentially trustworthy if 191 // considered potentially trustworthy if
195 // |isPotentiallyTrustworthyUniqueOrigin| is true. TODO(estark): 192 // |isPotentiallyTrustworthyUniqueOrigin| is true. TODO(estark):
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 { 686 {
690 return WebPageVisibilityStateVisible; 687 return WebPageVisibilityStateVisible;
691 } 688 }
692 689
693 // Overwrites the given URL to use an HTML5 embed if possible. 690 // Overwrites the given URL to use an HTML5 embed if possible.
694 // An empty URL is returned if the URL is not overriden. 691 // An empty URL is returned if the URL is not overriden.
695 virtual WebURL overrideFlashEmbedWithHTML(const WebURL& url) 692 virtual WebURL overrideFlashEmbedWithHTML(const WebURL& url)
696 { 693 {
697 return WebURL(); 694 return WebURL();
698 } 695 }
696
697 protected:
698 virtual ~WebFrameClient() { }
699 }; 699 };
700 700
701 } // namespace blink 701 } // namespace blink
702 702
703 #endif 703 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebViewTest.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698