OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/browser/webui/web_ui_impl.h" | 15 #include "content/browser/webui/web_ui_impl.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/frame_message_enums.h" | 17 #include "content/common/frame_message_enums.h" |
18 #include "content/public/browser/site_instance.h" | 18 #include "content/public/browser/site_instance.h" |
19 #include "content/public/common/javascript_message_type.h" | 19 #include "content/public/common/javascript_message_type.h" |
20 #include "content/public/common/media_stream_request.h" | 20 #include "content/public/common/media_stream_request.h" |
21 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 21 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
22 #include "net/http/http_response_headers.h" | 22 #include "net/http/http_response_headers.h" |
23 #include "ui/base/window_open_disposition.h" | |
23 | 24 |
24 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
25 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
26 #endif | 27 #endif |
27 | 28 |
28 class GURL; | 29 class GURL; |
29 | 30 |
30 namespace IPC { | 31 namespace IPC { |
31 class Message; | 32 class Message; |
32 } | 33 } |
33 | 34 |
34 namespace device { | 35 namespace device { |
35 class GeolocationServiceContext; | 36 class GeolocationServiceContext; |
36 class WakeLockServiceContext; | 37 class WakeLockServiceContext; |
37 } | 38 } |
38 | 39 |
40 namespace gfx { | |
41 class Rect; | |
42 } | |
43 | |
44 namespace mojom { | |
45 class CreateNewWindowParams; | |
alexmos
2016/12/13 18:41:40
Is this one needed? There's one defined below in
ncarter (slow)
2016/12/15 00:33:16
Done.
| |
46 } | |
47 | |
39 namespace content { | 48 namespace content { |
40 class FrameTreeNode; | 49 class FrameTreeNode; |
41 class InterstitialPage; | 50 class InterstitialPage; |
42 class PageState; | 51 class PageState; |
43 class RenderFrameHost; | 52 class RenderFrameHost; |
44 class ScreenOrientationProvider; | 53 class ScreenOrientationProvider; |
54 class SessionStorageNamespace; | |
45 class WebContents; | 55 class WebContents; |
46 struct AXEventNotificationDetails; | 56 struct AXEventNotificationDetails; |
47 struct AXLocationChangeNotificationDetails; | 57 struct AXLocationChangeNotificationDetails; |
48 struct ContextMenuParams; | 58 struct ContextMenuParams; |
49 struct FileChooserParams; | 59 struct FileChooserParams; |
50 | 60 |
61 namespace mojom { | |
62 class CreateNewWindowParams; | |
63 } | |
64 | |
51 // An interface implemented by an object interested in knowing about the state | 65 // An interface implemented by an object interested in knowing about the state |
52 // of the RenderFrameHost. | 66 // of the RenderFrameHost. |
53 class CONTENT_EXPORT RenderFrameHostDelegate { | 67 class CONTENT_EXPORT RenderFrameHostDelegate { |
54 public: | 68 public: |
55 // This is used to give the delegate a chance to filter IPC messages. | 69 // This is used to give the delegate a chance to filter IPC messages. |
56 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, | 70 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, |
57 const IPC::Message& message); | 71 const IPC::Message& message); |
58 | 72 |
59 // Allows the delegate to filter incoming associated inteface requests. | 73 // Allows the delegate to filter incoming associated inteface requests. |
60 virtual void OnAssociatedInterfaceRequest( | 74 virtual void OnAssociatedInterfaceRequest( |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 | 218 |
205 // Set the |node| frame as focused in the current FrameTree as well as | 219 // Set the |node| frame as focused in the current FrameTree as well as |
206 // possibly changing focus in distinct but related inner/outer WebContents. | 220 // possibly changing focus in distinct but related inner/outer WebContents. |
207 virtual void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) {} | 221 virtual void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) {} |
208 | 222 |
209 // Creates a WebUI object for a frame navigating to |url|. If no WebUI | 223 // Creates a WebUI object for a frame navigating to |url|. If no WebUI |
210 // applies, returns null. | 224 // applies, returns null. |
211 virtual std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( | 225 virtual std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( |
212 const GURL& url); | 226 const GURL& url); |
213 | 227 |
228 // The page is trying to open a new page (e.g. a popup window). The window | |
229 // should be created associated with the given |route_id| in the process of | |
alexmos
2016/12/13 18:41:40
Update |route_id|.
ncarter (slow)
2016/12/15 00:33:16
Done.
| |
230 // |source_site_instance|, but it should not be shown yet. That | |
231 // should happen in response to ShowCreatedWindow. | |
232 // |params.window_container_type| describes the type of RenderViewHost | |
233 // container that is requested -- in particular, the window.open call may | |
234 // have specified 'background' and 'persistent' in the feature string. | |
235 // | |
236 // The passed |params.frame_name| parameter is the name parameter that was | |
237 // passed to window.open(), and will be empty if none was passed. | |
238 // | |
239 // Note: this is not called "CreateWindow" because that will clash with | |
240 // the Windows function which is actually a #define. | |
241 // | |
242 // The caller is expected to handle cleanup if this operation fails or is | |
243 // suppressed, by looking for the existence of a RenderFrameHost in | |
244 // source_site_instance's process with |main_frame_route_id| after this method | |
245 // returns. | |
246 virtual void CreateNewWindow( | |
247 SiteInstance* source_site_instance, | |
248 int32_t render_view_route_id, | |
249 int32_t main_frame_route_id, | |
250 int32_t main_frame_widget_route_id, | |
251 const mojom::CreateNewWindowParams& params, | |
252 SessionStorageNamespace* session_storage_namespace) {} | |
253 | |
254 // Show a previously created page with the specified disposition and bounds. | |
255 // The window is identified by the |main_frame_widget_route_id| passed to | |
256 // CreateNewWindow. | |
257 // | |
258 // Note: this is not called "ShowWindow" because that will clash with | |
259 // the Windows function which is actually a #define. | |
260 virtual void ShowCreatedWindow(int process_id, | |
261 int main_frame_widget_route_id, | |
262 WindowOpenDisposition disposition, | |
263 const gfx::Rect& initial_rect, | |
264 bool user_gesture) {} | |
265 | |
214 protected: | 266 protected: |
215 virtual ~RenderFrameHostDelegate() {} | 267 virtual ~RenderFrameHostDelegate() {} |
216 }; | 268 }; |
217 | 269 |
218 } // namespace content | 270 } // namespace content |
219 | 271 |
220 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 272 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
OLD | NEW |