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" | 19 #include "ui/base/window_open_disposition.h" |
alexmos
2016/12/13 18:41:40
Can you now remove this too?
ncarter (slow)
2016/12/15 00:33:16
Done.
| |
20 | 20 |
21 class GURL; | 21 class GURL; |
22 | 22 |
23 namespace IPC { | 23 namespace IPC { |
24 class Message; | 24 class Message; |
25 } | 25 } |
26 | 26 |
27 namespace gfx { | 27 namespace gfx { |
28 class Rect; | 28 class Rect; |
29 class Size; | 29 class Size; |
30 } | 30 } |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 class BrowserContext; | 34 class BrowserContext; |
35 class FrameTree; | 35 class FrameTree; |
36 class PageState; | 36 class PageState; |
37 class RenderViewHost; | 37 class RenderViewHost; |
38 class RenderViewHostDelegateView; | 38 class RenderViewHostDelegateView; |
39 class SessionStorageNamespace; | 39 class SessionStorageNamespace; |
40 class SiteInstance; | 40 class SiteInstance; |
41 class WebContents; | 41 class WebContents; |
42 struct RendererPreferences; | 42 struct RendererPreferences; |
43 | 43 |
44 namespace mojom { | |
45 class CreateNewWindowParams; | |
46 } | |
47 | |
48 // | 44 // |
49 // RenderViewHostDelegate | 45 // RenderViewHostDelegate |
50 // | 46 // |
51 // An interface implemented by an object interested in knowing about the state | 47 // An interface implemented by an object interested in knowing about the state |
52 // of the RenderViewHost. | 48 // of the RenderViewHost. |
53 // | 49 // |
54 // This interface currently encompasses every type of message that was | 50 // This interface currently encompasses every type of message that was |
55 // previously being sent by WebContents itself. Some of these notifications | 51 // previously being sent by WebContents itself. Some of these notifications |
56 // may not be relevant to all users of RenderViewHost and we should consider | 52 // 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 | 53 // 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). | 120 // refocus on the modal dialog, flash title etc). |
125 virtual void OnIgnoredUIEvent() {} | 121 virtual void OnIgnoredUIEvent() {} |
126 | 122 |
127 // The page wants the hosting window to activate itself (it called the | 123 // The page wants the hosting window to activate itself (it called the |
128 // JavaScript window.focus() method). | 124 // JavaScript window.focus() method). |
129 virtual void Activate() {} | 125 virtual void Activate() {} |
130 | 126 |
131 // The contents' preferred size changed. | 127 // The contents' preferred size changed. |
132 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} | 128 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} |
133 | 129 |
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 | 130 // 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 | 131 // 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 | 132 // process |render_process_id|, but it should not be shown yet. That should |
162 // happen in response to ShowCreatedWidget. | 133 // happen in response to ShowCreatedWidget. |
163 // |popup_type| indicates if the widget is a popup and what kind of popup it | 134 // |popup_type| indicates if the widget is a popup and what kind of popup it |
164 // is (select, autofill...). | 135 // is (select, autofill...). |
165 virtual void CreateNewWidget(int32_t render_process_id, | 136 virtual void CreateNewWidget(int32_t render_process_id, |
166 int32_t route_id, | 137 int32_t route_id, |
167 blink::WebPopupType popup_type) {} | 138 blink::WebPopupType popup_type) {} |
168 | 139 |
169 // Creates a full screen RenderWidget. Similar to above. | 140 // Creates a full screen RenderWidget. Similar to above. |
170 virtual void CreateNewFullscreenWidget(int32_t render_process_id, | 141 virtual void CreateNewFullscreenWidget(int32_t render_process_id, |
171 int32_t route_id) {} | 142 int32_t route_id) {} |
172 | 143 |
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. | 144 // Show the newly created widget with the specified bounds. |
185 // The widget is identified by the route_id passed to CreateNewWidget. | 145 // The widget is identified by the route_id passed to CreateNewWidget. |
186 virtual void ShowCreatedWidget(int process_id, | 146 virtual void ShowCreatedWidget(int process_id, |
187 int route_id, | 147 int route_id, |
188 const gfx::Rect& initial_rect) {} | 148 const gfx::Rect& initial_rect) {} |
189 | 149 |
190 // Show the newly created full screen widget. Similar to above. | 150 // Show the newly created full screen widget. Similar to above. |
191 virtual void ShowCreatedFullscreenWidget(int process_id, int route_id) {} | 151 virtual void ShowCreatedFullscreenWidget(int process_id, int route_id) {} |
192 | 152 |
193 // Returns the SessionStorageNamespace the render view should use. Might | 153 // 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. | 190 // Whether download UI should be hidden. |
231 virtual bool HideDownloadUI() const; | 191 virtual bool HideDownloadUI() const; |
232 | 192 |
233 protected: | 193 protected: |
234 virtual ~RenderViewHostDelegate() {} | 194 virtual ~RenderViewHostDelegate() {} |
235 }; | 195 }; |
236 | 196 |
237 } // namespace content | 197 } // namespace content |
238 | 198 |
239 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 199 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
OLD | NEW |