| 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 RenderViewHostImpl; | 37 class RenderViewHostImpl; |
| 39 class RenderViewHostDelegateView; | 38 class RenderViewHostDelegateView; |
| 40 class SessionStorageNamespace; | 39 class SessionStorageNamespace; |
| 41 class SiteInstance; | 40 class SiteInstance; |
| 42 class WebContents; | 41 class WebContents; |
| 43 struct RendererPreferences; | 42 struct RendererPreferences; |
| 44 | 43 |
| 45 namespace mojom { | |
| 46 class CreateNewWindowParams; | |
| 47 } | |
| 48 | |
| 49 // | 44 // |
| 50 // RenderViewHostDelegate | 45 // RenderViewHostDelegate |
| 51 // | 46 // |
| 52 // 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 |
| 53 // of the RenderViewHost. | 48 // of the RenderViewHost. |
| 54 // | 49 // |
| 55 // This interface currently encompasses every type of message that was | 50 // This interface currently encompasses every type of message that was |
| 56 // previously being sent by WebContents itself. Some of these notifications | 51 // previously being sent by WebContents itself. Some of these notifications |
| 57 // 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 |
| 58 // 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... |
| 125 // refocus on the modal dialog, flash title etc). | 120 // refocus on the modal dialog, flash title etc). |
| 126 virtual void OnIgnoredUIEvent() {} | 121 virtual void OnIgnoredUIEvent() {} |
| 127 | 122 |
| 128 // 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 |
| 129 // JavaScript window.focus() method). | 124 // JavaScript window.focus() method). |
| 130 virtual void Activate() {} | 125 virtual void Activate() {} |
| 131 | 126 |
| 132 // The contents' preferred size changed. | 127 // The contents' preferred size changed. |
| 133 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} | 128 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} |
| 134 | 129 |
| 135 // The page is trying to open a new page (e.g. a popup window). The window | |
| 136 // should be created associated with the given |route_id| in the process of | |
| 137 // |source_site_instance|, but it should not be shown yet. That | |
| 138 // should happen in response to ShowCreatedWindow. | |
| 139 // |params.window_container_type| describes the type of RenderViewHost | |
| 140 // container that is requested -- in particular, the window.open call may | |
| 141 // have specified 'background' and 'persistent' in the feature string. | |
| 142 // | |
| 143 // The passed |params.frame_name| parameter is the name parameter that was | |
| 144 // passed to window.open(), and will be empty if none was passed. | |
| 145 // | |
| 146 // Note: this is not called "CreateWindow" because that will clash with | |
| 147 // the Windows function which is actually a #define. | |
| 148 // | |
| 149 // TODO(alexmos): This should be moved to RenderFrameHostDelegate, and the | |
| 150 // corresponding IPC message should be sent by the RenderFrame creating the | |
| 151 // new window. | |
| 152 virtual void CreateNewWindow( | |
| 153 SiteInstance* source_site_instance, | |
| 154 int32_t route_id, | |
| 155 int32_t main_frame_route_id, | |
| 156 int32_t main_frame_widget_route_id, | |
| 157 const mojom::CreateNewWindowParams& params, | |
| 158 SessionStorageNamespace* session_storage_namespace) {} | |
| 159 | |
| 160 // 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 |
| 161 // 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 |
| 162 // 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 |
| 163 // happen in response to ShowCreatedWidget. | 133 // happen in response to ShowCreatedWidget. |
| 164 // |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 |
| 165 // is (select, autofill...). | 135 // is (select, autofill...). |
| 166 virtual void CreateNewWidget(int32_t render_process_id, | 136 virtual void CreateNewWidget(int32_t render_process_id, |
| 167 int32_t route_id, | 137 int32_t route_id, |
| 168 blink::WebPopupType popup_type) {} | 138 blink::WebPopupType popup_type) {} |
| 169 | 139 |
| 170 // Creates a full screen RenderWidget. Similar to above. | 140 // Creates a full screen RenderWidget. Similar to above. |
| 171 virtual void CreateNewFullscreenWidget(int32_t render_process_id, | 141 virtual void CreateNewFullscreenWidget(int32_t render_process_id, |
| 172 int32_t route_id) {} | 142 int32_t route_id) {} |
| 173 | 143 |
| 174 // Show a previously created page with the specified disposition and bounds. | |
| 175 // The window is identified by the route_id passed to CreateNewWindow. | |
| 176 // | |
| 177 // Note: this is not called "ShowWindow" because that will clash with | |
| 178 // the Windows function which is actually a #define. | |
| 179 virtual void ShowCreatedWindow(int process_id, | |
| 180 int route_id, | |
| 181 WindowOpenDisposition disposition, | |
| 182 const gfx::Rect& initial_rect, | |
| 183 bool user_gesture) {} | |
| 184 | |
| 185 // Show the newly created widget with the specified bounds. | 144 // Show the newly created widget with the specified bounds. |
| 186 // The widget is identified by the route_id passed to CreateNewWidget. | 145 // The widget is identified by the route_id passed to CreateNewWidget. |
| 187 virtual void ShowCreatedWidget(int process_id, | 146 virtual void ShowCreatedWidget(int process_id, |
| 188 int route_id, | 147 int route_id, |
| 189 const gfx::Rect& initial_rect) {} | 148 const gfx::Rect& initial_rect) {} |
| 190 | 149 |
| 191 // Show the newly created full screen widget. Similar to above. | 150 // Show the newly created full screen widget. Similar to above. |
| 192 virtual void ShowCreatedFullscreenWidget(int process_id, int route_id) {} | 151 virtual void ShowCreatedFullscreenWidget(int process_id, int route_id) {} |
| 193 | 152 |
| 194 // Returns the SessionStorageNamespace the render view should use. Might | 153 // Returns the SessionStorageNamespace the render view should use. Might |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // the focused RenderWidget. | 198 // the focused RenderWidget. |
| 240 virtual void ClearFocusedElement() {} | 199 virtual void ClearFocusedElement() {} |
| 241 | 200 |
| 242 protected: | 201 protected: |
| 243 virtual ~RenderViewHostDelegate() {} | 202 virtual ~RenderViewHostDelegate() {} |
| 244 }; | 203 }; |
| 245 | 204 |
| 246 } // namespace content | 205 } // namespace content |
| 247 | 206 |
| 248 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 207 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
| OLD | NEW |