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 |
39 namespace content { | 44 namespace content { |
40 class FrameTreeNode; | 45 class FrameTreeNode; |
41 class InterstitialPage; | 46 class InterstitialPage; |
42 class PageState; | 47 class PageState; |
43 class RenderFrameHost; | 48 class RenderFrameHost; |
44 class ScreenOrientationProvider; | 49 class ScreenOrientationProvider; |
| 50 class SessionStorageNamespace; |
45 class WebContents; | 51 class WebContents; |
46 struct AXEventNotificationDetails; | 52 struct AXEventNotificationDetails; |
47 struct AXLocationChangeNotificationDetails; | 53 struct AXLocationChangeNotificationDetails; |
48 struct ContextMenuParams; | 54 struct ContextMenuParams; |
49 struct FileChooserParams; | 55 struct FileChooserParams; |
50 | 56 |
| 57 namespace mojom { |
| 58 class CreateNewWindowParams; |
| 59 } |
| 60 |
51 // An interface implemented by an object interested in knowing about the state | 61 // An interface implemented by an object interested in knowing about the state |
52 // of the RenderFrameHost. | 62 // of the RenderFrameHost. |
53 class CONTENT_EXPORT RenderFrameHostDelegate { | 63 class CONTENT_EXPORT RenderFrameHostDelegate { |
54 public: | 64 public: |
55 // This is used to give the delegate a chance to filter IPC messages. | 65 // This is used to give the delegate a chance to filter IPC messages. |
56 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, | 66 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, |
57 const IPC::Message& message); | 67 const IPC::Message& message); |
58 | 68 |
59 // Allows the delegate to filter incoming associated inteface requests. | 69 // Allows the delegate to filter incoming associated inteface requests. |
60 virtual void OnAssociatedInterfaceRequest( | 70 virtual void OnAssociatedInterfaceRequest( |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 214 |
205 // Set the |node| frame as focused in the current FrameTree as well as | 215 // Set the |node| frame as focused in the current FrameTree as well as |
206 // possibly changing focus in distinct but related inner/outer WebContents. | 216 // possibly changing focus in distinct but related inner/outer WebContents. |
207 virtual void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) {} | 217 virtual void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) {} |
208 | 218 |
209 // Creates a WebUI object for a frame navigating to |url|. If no WebUI | 219 // Creates a WebUI object for a frame navigating to |url|. If no WebUI |
210 // applies, returns null. | 220 // applies, returns null. |
211 virtual std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( | 221 virtual std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( |
212 const GURL& url); | 222 const GURL& url); |
213 | 223 |
| 224 // The page is trying to open a new page (e.g. a popup window). The window |
| 225 // should be created associated with the given |main_frame_widget_route_id| in |
| 226 // the process of |source_site_instance|, but it should not be shown yet. That |
| 227 // should happen in response to ShowCreatedWindow. |
| 228 // |params.window_container_type| describes the type of RenderViewHost |
| 229 // container that is requested -- in particular, the window.open call may have |
| 230 // specified 'background' and 'persistent' in the feature string. |
| 231 // |
| 232 // The passed |params.frame_name| parameter is the name parameter that was |
| 233 // passed to window.open(), and will be empty if none was passed. |
| 234 // |
| 235 // Note: this is not called "CreateWindow" because that will clash with |
| 236 // the Windows function which is actually a #define. |
| 237 // |
| 238 // The caller is expected to handle cleanup if this operation fails or is |
| 239 // suppressed, by looking for the existence of a RenderFrameHost in |
| 240 // source_site_instance's process with |main_frame_route_id| after this method |
| 241 // returns. |
| 242 virtual void CreateNewWindow( |
| 243 SiteInstance* source_site_instance, |
| 244 int32_t render_view_route_id, |
| 245 int32_t main_frame_route_id, |
| 246 int32_t main_frame_widget_route_id, |
| 247 const mojom::CreateNewWindowParams& params, |
| 248 SessionStorageNamespace* session_storage_namespace) {} |
| 249 |
| 250 // Show a previously created page with the specified disposition and bounds. |
| 251 // The window is identified by the |main_frame_widget_route_id| passed to |
| 252 // CreateNewWindow. |
| 253 // |
| 254 // Note: this is not called "ShowWindow" because that will clash with |
| 255 // the Windows function which is actually a #define. |
| 256 virtual void ShowCreatedWindow(int process_id, |
| 257 int main_frame_widget_route_id, |
| 258 WindowOpenDisposition disposition, |
| 259 const gfx::Rect& initial_rect, |
| 260 bool user_gesture) {} |
| 261 |
214 protected: | 262 protected: |
215 virtual ~RenderFrameHostDelegate() {} | 263 virtual ~RenderFrameHostDelegate() {} |
216 }; | 264 }; |
217 | 265 |
218 } // namespace content | 266 } // namespace content |
219 | 267 |
220 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 268 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
OLD | NEW |