| 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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/public/browser/render_frame_host.h" | 16 #include "content/public/browser/render_frame_host.h" |
| 17 #include "content/public/common/javascript_message_type.h" |
| 17 #include "content/public/common/page_transition_types.h" | 18 #include "content/public/common/page_transition_types.h" |
| 18 | 19 |
| 19 class GURL; | 20 class GURL; |
| 20 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; | 21 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; |
| 21 struct FrameHostMsg_OpenURL_Params; | 22 struct FrameHostMsg_OpenURL_Params; |
| 22 struct FrameMsg_Navigate_Params; | 23 struct FrameMsg_Navigate_Params; |
| 23 | 24 |
| 24 namespace base { | 25 namespace base { |
| 25 class FilePath; | 26 class FilePath; |
| 26 class ListValue; | 27 class ListValue; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Load the specified URL; this is a shortcut for Navigate(). | 162 // Load the specified URL; this is a shortcut for Navigate(). |
| 162 void NavigateToURL(const GURL& url); | 163 void NavigateToURL(const GURL& url); |
| 163 | 164 |
| 164 // Requests the renderer to select the region between two points. | 165 // Requests the renderer to select the region between two points. |
| 165 void SelectRange(const gfx::Point& start, const gfx::Point& end); | 166 void SelectRange(const gfx::Point& start, const gfx::Point& end); |
| 166 | 167 |
| 167 // Deletes the current selection plus the specified number of characters | 168 // Deletes the current selection plus the specified number of characters |
| 168 // before and after the selection or caret. | 169 // before and after the selection or caret. |
| 169 void ExtendSelectionAndDelete(size_t before, size_t after); | 170 void ExtendSelectionAndDelete(size_t before, size_t after); |
| 170 | 171 |
| 172 // Notifies the RenderFrame that the JavaScript message that was shown was |
| 173 // closed by the user. |
| 174 void JavaScriptDialogClosed(IPC::Message* reply_msg, |
| 175 bool success, |
| 176 const base::string16& user_input, |
| 177 bool dialog_was_suppressed); |
| 178 |
| 171 protected: | 179 protected: |
| 172 friend class RenderFrameHostFactory; | 180 friend class RenderFrameHostFactory; |
| 173 | 181 |
| 174 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost | 182 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost |
| 175 // should be the abstraction needed here, but we need RenderViewHost to pass | 183 // should be the abstraction needed here, but we need RenderViewHost to pass |
| 176 // into WebContentsObserver::FrameDetached for now. | 184 // into WebContentsObserver::FrameDetached for now. |
| 177 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, | 185 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, |
| 178 RenderFrameHostDelegate* delegate, | 186 RenderFrameHostDelegate* delegate, |
| 179 FrameTree* frame_tree, | 187 FrameTree* frame_tree, |
| 180 FrameTreeNode* frame_tree_node, | 188 FrameTreeNode* frame_tree_node, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 206 const GURL& target_url); | 214 const GURL& target_url); |
| 207 void OnNavigate(const IPC::Message& msg); | 215 void OnNavigate(const IPC::Message& msg); |
| 208 void OnDidStopLoading(); | 216 void OnDidStopLoading(); |
| 209 void OnBeforeUnloadACK( | 217 void OnBeforeUnloadACK( |
| 210 bool proceed, | 218 bool proceed, |
| 211 const base::TimeTicks& renderer_before_unload_start_time, | 219 const base::TimeTicks& renderer_before_unload_start_time, |
| 212 const base::TimeTicks& renderer_before_unload_end_time); | 220 const base::TimeTicks& renderer_before_unload_end_time); |
| 213 void OnSwapOutACK(); | 221 void OnSwapOutACK(); |
| 214 void OnContextMenu(const ContextMenuParams& params); | 222 void OnContextMenu(const ContextMenuParams& params); |
| 215 void OnJavaScriptExecuteResponse(int id, const base::ListValue& result); | 223 void OnJavaScriptExecuteResponse(int id, const base::ListValue& result); |
| 224 void OnRunJavaScriptMessage(const base::string16& message, |
| 225 const base::string16& default_prompt, |
| 226 const GURL& frame_url, |
| 227 JavaScriptMessageType type, |
| 228 IPC::Message* reply_msg); |
| 229 void OnRunBeforeUnloadConfirm(const GURL& frame_url, |
| 230 const base::string16& message, |
| 231 bool is_reload, |
| 232 IPC::Message* reply_msg); |
| 216 | 233 |
| 217 // Returns whether the given URL is allowed to commit in the current process. | 234 // Returns whether the given URL is allowed to commit in the current process. |
| 218 // This is a more conservative check than RenderProcessHost::FilterURL, since | 235 // This is a more conservative check than RenderProcessHost::FilterURL, since |
| 219 // it will be used to kill processes that commit unauthorized URLs. | 236 // it will be used to kill processes that commit unauthorized URLs. |
| 220 bool CanCommitURL(const GURL& url); | 237 bool CanCommitURL(const GURL& url); |
| 221 | 238 |
| 222 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 239 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| 223 // refcount that calls Shutdown when it reaches zero. This allows each | 240 // refcount that calls Shutdown when it reaches zero. This allows each |
| 224 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 241 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| 225 // we have a RenderViewHost for each RenderFrameHost. | 242 // we have a RenderViewHost for each RenderFrameHost. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 275 |
| 259 // When the last BeforeUnload message was sent. | 276 // When the last BeforeUnload message was sent. |
| 260 base::TimeTicks send_before_unload_start_time_; | 277 base::TimeTicks send_before_unload_start_time_; |
| 261 | 278 |
| 262 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 279 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 263 }; | 280 }; |
| 264 | 281 |
| 265 } // namespace content | 282 } // namespace content |
| 266 | 283 |
| 267 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 284 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |