OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/process/kill.h" | 13 #include "base/process/kill.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 15 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "net/base/load_states.h" | 17 #include "net/base/load_states.h" |
18 #include "third_party/WebKit/public/web/WebPopupType.h" | 18 #include "third_party/WebKit/public/web/WebPopupType.h" |
19 #include "ui/base/window_open_disposition.h" | |
20 | 19 |
21 class GURL; | 20 class GURL; |
22 | 21 |
23 namespace IPC { | 22 namespace IPC { |
24 class Message; | 23 class Message; |
25 } | 24 } |
26 | 25 |
27 namespace gfx { | 26 namespace gfx { |
28 class Rect; | 27 class Rect; |
29 class Size; | 28 class Size; |
30 } | 29 } |
31 | 30 |
32 namespace content { | 31 namespace content { |
33 | 32 |
34 class BrowserContext; | 33 class BrowserContext; |
35 class FrameTree; | 34 class FrameTree; |
36 class PageState; | 35 class PageState; |
37 class RenderViewHost; | 36 class RenderViewHost; |
38 class RenderViewHostDelegateView; | 37 class RenderViewHostDelegateView; |
39 class SessionStorageNamespace; | 38 class SessionStorageNamespace; |
40 class SiteInstance; | 39 class SiteInstance; |
41 class WebContents; | 40 class WebContents; |
42 struct RendererPreferences; | 41 struct RendererPreferences; |
43 | 42 |
44 namespace mojom { | |
45 class CreateNewWindowParams; | |
46 } | |
47 | |
48 // | 43 // |
49 // RenderViewHostDelegate | 44 // RenderViewHostDelegate |
50 // | 45 // |
51 // An interface implemented by an object interested in knowing about the state | 46 // An interface implemented by an object interested in knowing about the state |
52 // of the RenderViewHost. | 47 // of the RenderViewHost. |
53 // | 48 // |
54 // This interface currently encompasses every type of message that was | 49 // This interface currently encompasses every type of message that was |
55 // previously being sent by WebContents itself. Some of these notifications | 50 // previously being sent by WebContents itself. Some of these notifications |
56 // may not be relevant to all users of RenderViewHost and we should consider | 51 // may not be relevant to all users of RenderViewHost and we should consider |
57 // exposing a more generic Send function on RenderViewHost and a response | 52 // exposing a more generic Send function on RenderViewHost and a response |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // refocus on the modal dialog, flash title etc). | 119 // refocus on the modal dialog, flash title etc). |
125 virtual void OnIgnoredUIEvent() {} | 120 virtual void OnIgnoredUIEvent() {} |
126 | 121 |
127 // The page wants the hosting window to activate itself (it called the | 122 // The page wants the hosting window to activate itself (it called the |
128 // JavaScript window.focus() method). | 123 // JavaScript window.focus() method). |
129 virtual void Activate() {} | 124 virtual void Activate() {} |
130 | 125 |
131 // The contents' preferred size changed. | 126 // The contents' preferred size changed. |
132 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} | 127 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} |
133 | 128 |
134 // The page is trying to open a new page (e.g. a popup window). The window | |
135 // should be created associated with the given |route_id| in the process of | |
136 // |source_site_instance|, but it should not be shown yet. That | |
137 // should happen in response to ShowCreatedWindow. | |
138 // |params.window_container_type| describes the type of RenderViewHost | |
139 // container that is requested -- in particular, the window.open call may | |
140 // have specified 'background' and 'persistent' in the feature string. | |
141 // | |
142 // The passed |params.frame_name| parameter is the name parameter that was | |
143 // passed to window.open(), and will be empty if none was passed. | |
144 // | |
145 // Note: this is not called "CreateWindow" because that will clash with | |
146 // the Windows function which is actually a #define. | |
147 // | |
148 // TODO(alexmos): This should be moved to RenderFrameHostDelegate, and the | |
149 // corresponding IPC message should be sent by the RenderFrame creating the | |
150 // new window. | |
151 virtual void CreateNewWindow( | |
152 SiteInstance* source_site_instance, | |
153 int32_t route_id, | |
154 int32_t main_frame_route_id, | |
155 int32_t main_frame_widget_route_id, | |
156 const mojom::CreateNewWindowParams& params, | |
157 SessionStorageNamespace* session_storage_namespace) {} | |
158 | |
159 // The page is trying to open a new widget (e.g. a select popup). The | 129 // The page is trying to open a new widget (e.g. a select popup). The |
160 // widget should be created associated with the given |route_id| in the | 130 // widget should be created associated with the given |route_id| in the |
161 // process |render_process_id|, but it should not be shown yet. That should | 131 // process |render_process_id|, but it should not be shown yet. That should |
162 // happen in response to ShowCreatedWidget. | 132 // happen in response to ShowCreatedWidget. |
163 // |popup_type| indicates if the widget is a popup and what kind of popup it | 133 // |popup_type| indicates if the widget is a popup and what kind of popup it |
164 // is (select, autofill...). | 134 // is (select, autofill...). |
165 virtual void CreateNewWidget(int32_t render_process_id, | 135 virtual void CreateNewWidget(int32_t render_process_id, |
166 int32_t route_id, | 136 int32_t route_id, |
167 blink::WebPopupType popup_type) {} | 137 blink::WebPopupType popup_type) {} |
168 | 138 |
169 // Creates a full screen RenderWidget. Similar to above. | 139 // Creates a full screen RenderWidget. Similar to above. |
170 virtual void CreateNewFullscreenWidget(int32_t render_process_id, | 140 virtual void CreateNewFullscreenWidget(int32_t render_process_id, |
171 int32_t route_id) {} | 141 int32_t route_id) {} |
172 | 142 |
173 // Show a previously created page with the specified disposition and bounds. | |
174 // The window is identified by the route_id passed to CreateNewWindow. | |
175 // | |
176 // Note: this is not called "ShowWindow" because that will clash with | |
177 // the Windows function which is actually a #define. | |
178 virtual void ShowCreatedWindow(int process_id, | |
179 int route_id, | |
180 WindowOpenDisposition disposition, | |
181 const gfx::Rect& initial_rect, | |
182 bool user_gesture) {} | |
183 | |
184 // Show the newly created widget with the specified bounds. | 143 // Show the newly created widget with the specified bounds. |
185 // The widget is identified by the route_id passed to CreateNewWidget. | 144 // The widget is identified by the route_id passed to CreateNewWidget. |
186 virtual void ShowCreatedWidget(int process_id, | 145 virtual void ShowCreatedWidget(int process_id, |
187 int route_id, | 146 int route_id, |
188 const gfx::Rect& initial_rect) {} | 147 const gfx::Rect& initial_rect) {} |
189 | 148 |
190 // Show the newly created full screen widget. Similar to above. | 149 // Show the newly created full screen widget. Similar to above. |
191 virtual void ShowCreatedFullscreenWidget(int process_id, int route_id) {} | 150 virtual void ShowCreatedFullscreenWidget(int process_id, int route_id) {} |
192 | 151 |
193 // Returns the SessionStorageNamespace the render view should use. Might | 152 // Returns the SessionStorageNamespace the render view should use. Might |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // Whether download UI should be hidden. | 189 // Whether download UI should be hidden. |
231 virtual bool HideDownloadUI() const; | 190 virtual bool HideDownloadUI() const; |
232 | 191 |
233 protected: | 192 protected: |
234 virtual ~RenderViewHostDelegate() {} | 193 virtual ~RenderViewHostDelegate() {} |
235 }; | 194 }; |
236 | 195 |
237 } // namespace content | 196 } // namespace content |
238 | 197 |
239 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 198 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
OLD | NEW |