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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // rather than sending it. | 253 // rather than sending it. |
254 // TODO(nasko): Remove this method once all callers are converted to use | 254 // TODO(nasko): Remove this method once all callers are converted to use |
255 // RenderFrameHostImpl. | 255 // RenderFrameHostImpl. |
256 void Navigate(const FrameMsg_Navigate_Params& message); | 256 void Navigate(const FrameMsg_Navigate_Params& message); |
257 | 257 |
258 // Load the specified URL, this is a shortcut for Navigate(). | 258 // Load the specified URL, this is a shortcut for Navigate(). |
259 // TODO(nasko): Remove this method once all callers are converted to use | 259 // TODO(nasko): Remove this method once all callers are converted to use |
260 // RenderFrameHostImpl. | 260 // RenderFrameHostImpl. |
261 void NavigateToURL(const GURL& url); | 261 void NavigateToURL(const GURL& url); |
262 | 262 |
| 263 // Returns whether navigation messages are currently suspended for this |
| 264 // RenderViewHost. Only true during a cross-site navigation, while waiting |
| 265 // for the onbeforeunload handler. |
| 266 bool are_navigations_suspended() const { return navigations_suspended_; } |
| 267 |
| 268 // Suspends (or unsuspends) any navigation messages from being sent from this |
| 269 // RenderViewHost. This is called when a pending RenderViewHost is created |
| 270 // for a cross-site navigation, because we must suspend any navigations until |
| 271 // we hear back from the old renderer's onbeforeunload handler. Note that it |
| 272 // is important that only one navigation event happen after calling this |
| 273 // method with |suspend| equal to true. If |suspend| is false and there is |
| 274 // a suspended_nav_message_, this will send the message. This function |
| 275 // should only be called to toggle the state; callers should check |
| 276 // are_navigations_suspended() first. If |suspend| is false, the time that the |
| 277 // user decided the navigation should proceed should be passed as |
| 278 // |proceed_time|. |
| 279 void SetNavigationsSuspended(bool suspend, |
| 280 const base::TimeTicks& proceed_time); |
| 281 |
| 282 // Clears any suspended navigation state after a cross-site navigation is |
| 283 // canceled or suspended. This is important if we later return to this |
| 284 // RenderViewHost. |
| 285 void CancelSuspendedNavigations(); |
| 286 |
263 // Whether this RenderViewHost has been swapped out to be displayed by a | 287 // Whether this RenderViewHost has been swapped out to be displayed by a |
264 // different process. | 288 // different process. |
265 bool IsSwappedOut() const { return rvh_state_ == STATE_SWAPPED_OUT; } | 289 bool IsSwappedOut() const { return rvh_state_ == STATE_SWAPPED_OUT; } |
266 | 290 |
267 // The current state of this RVH. | 291 // The current state of this RVH. |
268 RenderViewHostImplState rvh_state() const { return rvh_state_; } | 292 RenderViewHostImplState rvh_state() const { return rvh_state_; } |
269 | 293 |
270 // Tells the renderer that this RenderView will soon be swapped out, and thus | 294 // Tells the renderer that this RenderView will soon be swapped out, and thus |
271 // not to create any new modal dialogs until it happens. This must be done | 295 // not to create any new modal dialogs until it happens. This must be done |
272 // separately so that the PageGroupLoadDeferrers of any current dialogs are no | 296 // separately so that the PageGroupLoadDeferrers of any current dialogs are no |
(...skipping 12 matching lines...) Expand all Loading... |
285 | 309 |
286 // Set |this| as pending shutdown. |on_swap_out| will be called | 310 // Set |this| as pending shutdown. |on_swap_out| will be called |
287 // when the SwapOutACK is received, or when the unload timer times out. | 311 // when the SwapOutACK is received, or when the unload timer times out. |
288 void SetPendingShutdown(const base::Closure& on_swap_out); | 312 void SetPendingShutdown(const base::Closure& on_swap_out); |
289 | 313 |
290 // Close the page ignoring whether it has unload events registers. | 314 // Close the page ignoring whether it has unload events registers. |
291 // This is called after the beforeunload and unload events have fired | 315 // This is called after the beforeunload and unload events have fired |
292 // and the user has agreed to continue with closing the page. | 316 // and the user has agreed to continue with closing the page. |
293 void ClosePageIgnoringUnloadEvents(); | 317 void ClosePageIgnoringUnloadEvents(); |
294 | 318 |
| 319 // Returns whether this RenderViewHost has an outstanding cross-site request. |
| 320 // Cleared when we hear the response and start to swap out the old |
| 321 // RenderViewHost, or if we hear a commit here without a network request. |
| 322 bool HasPendingCrossSiteRequest(); |
| 323 |
| 324 // Sets whether this RenderViewHost has an outstanding cross-site request, |
| 325 // for which another renderer will need to run an onunload event handler. |
| 326 // This is called before the first navigation event for this RenderViewHost, |
| 327 // and cleared when we hear the response or commit. |
| 328 void SetHasPendingCrossSiteRequest(bool has_pending_request); |
| 329 |
295 // Tells the renderer view to focus the first (last if reverse is true) node. | 330 // Tells the renderer view to focus the first (last if reverse is true) node. |
296 void SetInitialFocus(bool reverse); | 331 void SetInitialFocus(bool reverse); |
297 | 332 |
298 // Get html data by serializing all frames of current page with lists | 333 // Get html data by serializing all frames of current page with lists |
299 // which contain all resource links that have local copy. | 334 // which contain all resource links that have local copy. |
300 // The parameter links contain original URLs of all saved links. | 335 // The parameter links contain original URLs of all saved links. |
301 // The parameter local_paths contain corresponding local file paths of | 336 // The parameter local_paths contain corresponding local file paths of |
302 // all saved links, which matched with vector:links one by one. | 337 // all saved links, which matched with vector:links one by one. |
303 // The parameter local_directory_name is relative path of directory which | 338 // The parameter local_directory_name is relative path of directory which |
304 // contain all saved auxiliary files included all sub frames and resouces. | 339 // contain all saved auxiliary files included all sub frames and resouces. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 scoped_refptr<SiteInstanceImpl> instance_; | 527 scoped_refptr<SiteInstanceImpl> instance_; |
493 | 528 |
494 // true if we are currently waiting for a response for drag context | 529 // true if we are currently waiting for a response for drag context |
495 // information. | 530 // information. |
496 bool waiting_for_drag_context_response_; | 531 bool waiting_for_drag_context_response_; |
497 | 532 |
498 // A bitwise OR of bindings types that have been enabled for this RenderView. | 533 // A bitwise OR of bindings types that have been enabled for this RenderView. |
499 // See BindingsPolicy for details. | 534 // See BindingsPolicy for details. |
500 int enabled_bindings_; | 535 int enabled_bindings_; |
501 | 536 |
| 537 // Whether we should buffer outgoing Navigate messages rather than sending |
| 538 // them. This will be true when a RenderViewHost is created for a cross-site |
| 539 // request, until we hear back from the onbeforeunload handler of the old |
| 540 // RenderViewHost. |
| 541 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
| 542 bool navigations_suspended_; |
| 543 |
| 544 // We only buffer the params for a suspended navigation while we have a |
| 545 // pending RVH for a WebContentsImpl. There will only ever be one suspended |
| 546 // navigation, because WebContentsImpl will destroy the pending RVH and create |
| 547 // a new one if a second navigation occurs. |
| 548 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
| 549 scoped_ptr<FrameMsg_Navigate_Params> suspended_nav_params_; |
502 | 550 |
503 // The current state of this RVH. | 551 // The current state of this RVH. |
504 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 552 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
505 RenderViewHostImplState rvh_state_; | 553 RenderViewHostImplState rvh_state_; |
506 | 554 |
507 // Routing ID for the main frame's RenderFrameHost. | 555 // Routing ID for the main frame's RenderFrameHost. |
508 int main_frame_routing_id_; | 556 int main_frame_routing_id_; |
509 | 557 |
510 // If we were asked to RunModal, then this will hold the reply_msg that we | 558 // If we were asked to RunModal, then this will hold the reply_msg that we |
511 // must return to the renderer to unblock it. | 559 // must return to the renderer to unblock it. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 618 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
571 }; | 619 }; |
572 | 620 |
573 #if defined(COMPILER_MSVC) | 621 #if defined(COMPILER_MSVC) |
574 #pragma warning(pop) | 622 #pragma warning(pop) |
575 #endif | 623 #endif |
576 | 624 |
577 } // namespace content | 625 } // namespace content |
578 | 626 |
579 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 627 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |