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 |
39 namespace gfx { | 40 namespace gfx { |
40 class Rect; | 41 class Rect; |
41 } | 42 } |
42 | 43 |
43 namespace content { | 44 namespace content { |
44 class FrameTreeNode; | 45 class FrameTreeNode; |
45 class InterstitialPage; | 46 class InterstitialPage; |
46 class PageState; | 47 class PageState; |
47 class RenderFrameHost; | 48 class RenderFrameHost; |
48 class RenderFrameHostImpl; | 49 class RenderFrameHostImpl; |
49 class ScreenOrientationProvider; | 50 class ScreenOrientationProvider; |
| 51 class SessionStorageNamespace; |
50 class WebContents; | 52 class WebContents; |
51 struct AXEventNotificationDetails; | 53 struct AXEventNotificationDetails; |
52 struct AXLocationChangeNotificationDetails; | 54 struct AXLocationChangeNotificationDetails; |
53 struct ContextMenuParams; | 55 struct ContextMenuParams; |
54 struct FileChooserParams; | 56 struct FileChooserParams; |
55 | 57 |
| 58 namespace mojom { |
| 59 class CreateNewWindowParams; |
| 60 } |
| 61 |
56 // An interface implemented by an object interested in knowing about the state | 62 // An interface implemented by an object interested in knowing about the state |
57 // of the RenderFrameHost. | 63 // of the RenderFrameHost. |
58 class CONTENT_EXPORT RenderFrameHostDelegate { | 64 class CONTENT_EXPORT RenderFrameHostDelegate { |
59 public: | 65 public: |
60 // This is used to give the delegate a chance to filter IPC messages. | 66 // This is used to give the delegate a chance to filter IPC messages. |
61 virtual bool OnMessageReceived(RenderFrameHostImpl* render_frame_host, | 67 virtual bool OnMessageReceived(RenderFrameHostImpl* render_frame_host, |
62 const IPC::Message& message); | 68 const IPC::Message& message); |
63 | 69 |
64 // Allows the delegate to filter incoming associated inteface requests. | 70 // Allows the delegate to filter incoming associated inteface requests. |
65 virtual void OnAssociatedInterfaceRequest( | 71 virtual void OnAssociatedInterfaceRequest( |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 const GURL& url); | 224 const GURL& url); |
219 | 225 |
220 // Called by |frame| to notify that it has received an update on focused | 226 // Called by |frame| to notify that it has received an update on focused |
221 // element. |bounds_in_root_view| is the rectangle containing the element that | 227 // element. |bounds_in_root_view| is the rectangle containing the element that |
222 // is focused and is with respect to root frame's RenderWidgetHost's | 228 // is focused and is with respect to root frame's RenderWidgetHost's |
223 // coordinate space. | 229 // coordinate space. |
224 virtual void OnFocusedElementChangedInFrame( | 230 virtual void OnFocusedElementChangedInFrame( |
225 RenderFrameHostImpl* frame, | 231 RenderFrameHostImpl* frame, |
226 const gfx::Rect& bounds_in_root_view) {} | 232 const gfx::Rect& bounds_in_root_view) {} |
227 | 233 |
| 234 // The page is trying to open a new page (e.g. a popup window). The window |
| 235 // should be created associated with the given |main_frame_widget_route_id| in |
| 236 // the process of |source_site_instance|, but it should not be shown yet. That |
| 237 // should happen in response to ShowCreatedWindow. |
| 238 // |params.window_container_type| describes the type of RenderViewHost |
| 239 // container that is requested -- in particular, the window.open call may have |
| 240 // specified 'background' and 'persistent' in the feature string. |
| 241 // |
| 242 // The passed |params.frame_name| parameter is the name parameter that was |
| 243 // passed to window.open(), and will be empty if none was passed. |
| 244 // |
| 245 // Note: this is not called "CreateWindow" because that will clash with |
| 246 // the Windows function which is actually a #define. |
| 247 // |
| 248 // The caller is expected to handle cleanup if this operation fails or is |
| 249 // suppressed, by looking for the existence of a RenderFrameHost in |
| 250 // source_site_instance's process with |main_frame_route_id| after this method |
| 251 // returns. |
| 252 virtual void CreateNewWindow( |
| 253 SiteInstance* source_site_instance, |
| 254 int32_t render_view_route_id, |
| 255 int32_t main_frame_route_id, |
| 256 int32_t main_frame_widget_route_id, |
| 257 const mojom::CreateNewWindowParams& params, |
| 258 SessionStorageNamespace* session_storage_namespace) {} |
| 259 |
| 260 // Show a previously created page with the specified disposition and bounds. |
| 261 // The window is identified by the |main_frame_widget_route_id| passed to |
| 262 // CreateNewWindow. |
| 263 // |
| 264 // Note: this is not called "ShowWindow" because that will clash with |
| 265 // the Windows function which is actually a #define. |
| 266 virtual void ShowCreatedWindow(int process_id, |
| 267 int main_frame_widget_route_id, |
| 268 WindowOpenDisposition disposition, |
| 269 const gfx::Rect& initial_rect, |
| 270 bool user_gesture) {} |
| 271 |
228 protected: | 272 protected: |
229 virtual ~RenderFrameHostDelegate() {} | 273 virtual ~RenderFrameHostDelegate() {} |
230 }; | 274 }; |
231 | 275 |
232 } // namespace content | 276 } // namespace content |
233 | 277 |
234 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 278 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
OLD | NEW |