| 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 | |
| 287 // Whether this RenderViewHost has been swapped out to be displayed by a | 263 // Whether this RenderViewHost has been swapped out to be displayed by a |
| 288 // different process. | 264 // different process. |
| 289 bool IsSwappedOut() const { return rvh_state_ == STATE_SWAPPED_OUT; } | 265 bool IsSwappedOut() const { return rvh_state_ == STATE_SWAPPED_OUT; } |
| 290 | 266 |
| 291 // The current state of this RVH. | 267 // The current state of this RVH. |
| 292 RenderViewHostImplState rvh_state() const { return rvh_state_; } | 268 RenderViewHostImplState rvh_state() const { return rvh_state_; } |
| 293 | 269 |
| 294 // Tells the renderer that this RenderView will soon be swapped out, and thus | 270 // Tells the renderer that this RenderView will soon be swapped out, and thus |
| 295 // not to create any new modal dialogs until it happens. This must be done | 271 // not to create any new modal dialogs until it happens. This must be done |
| 296 // separately so that the PageGroupLoadDeferrers of any current dialogs are no | 272 // separately so that the PageGroupLoadDeferrers of any current dialogs are no |
| (...skipping 12 matching lines...) Expand all Loading... |
| 309 | 285 |
| 310 // Set |this| as pending shutdown. |on_swap_out| will be called | 286 // Set |this| as pending shutdown. |on_swap_out| will be called |
| 311 // when the SwapOutACK is received, or when the unload timer times out. | 287 // when the SwapOutACK is received, or when the unload timer times out. |
| 312 void SetPendingShutdown(const base::Closure& on_swap_out); | 288 void SetPendingShutdown(const base::Closure& on_swap_out); |
| 313 | 289 |
| 314 // Close the page ignoring whether it has unload events registers. | 290 // Close the page ignoring whether it has unload events registers. |
| 315 // This is called after the beforeunload and unload events have fired | 291 // This is called after the beforeunload and unload events have fired |
| 316 // and the user has agreed to continue with closing the page. | 292 // and the user has agreed to continue with closing the page. |
| 317 void ClosePageIgnoringUnloadEvents(); | 293 void ClosePageIgnoringUnloadEvents(); |
| 318 | 294 |
| 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 | |
| 330 // Tells the renderer view to focus the first (last if reverse is true) node. | 295 // Tells the renderer view to focus the first (last if reverse is true) node. |
| 331 void SetInitialFocus(bool reverse); | 296 void SetInitialFocus(bool reverse); |
| 332 | 297 |
| 333 // Get html data by serializing all frames of current page with lists | 298 // Get html data by serializing all frames of current page with lists |
| 334 // which contain all resource links that have local copy. | 299 // which contain all resource links that have local copy. |
| 335 // The parameter links contain original URLs of all saved links. | 300 // The parameter links contain original URLs of all saved links. |
| 336 // The parameter local_paths contain corresponding local file paths of | 301 // The parameter local_paths contain corresponding local file paths of |
| 337 // all saved links, which matched with vector:links one by one. | 302 // all saved links, which matched with vector:links one by one. |
| 338 // The parameter local_directory_name is relative path of directory which | 303 // The parameter local_directory_name is relative path of directory which |
| 339 // contain all saved auxiliary files included all sub frames and resouces. | 304 // contain all saved auxiliary files included all sub frames and resouces. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 scoped_refptr<SiteInstanceImpl> instance_; | 492 scoped_refptr<SiteInstanceImpl> instance_; |
| 528 | 493 |
| 529 // true if we are currently waiting for a response for drag context | 494 // true if we are currently waiting for a response for drag context |
| 530 // information. | 495 // information. |
| 531 bool waiting_for_drag_context_response_; | 496 bool waiting_for_drag_context_response_; |
| 532 | 497 |
| 533 // A bitwise OR of bindings types that have been enabled for this RenderView. | 498 // A bitwise OR of bindings types that have been enabled for this RenderView. |
| 534 // See BindingsPolicy for details. | 499 // See BindingsPolicy for details. |
| 535 int enabled_bindings_; | 500 int enabled_bindings_; |
| 536 | 501 |
| 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_; | |
| 550 | 502 |
| 551 // The current state of this RVH. | 503 // The current state of this RVH. |
| 552 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 504 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
| 553 RenderViewHostImplState rvh_state_; | 505 RenderViewHostImplState rvh_state_; |
| 554 | 506 |
| 555 // Routing ID for the main frame's RenderFrameHost. | 507 // Routing ID for the main frame's RenderFrameHost. |
| 556 int main_frame_routing_id_; | 508 int main_frame_routing_id_; |
| 557 | 509 |
| 558 // If we were asked to RunModal, then this will hold the reply_msg that we | 510 // If we were asked to RunModal, then this will hold the reply_msg that we |
| 559 // must return to the renderer to unblock it. | 511 // must return to the renderer to unblock it. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 570 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
| 619 }; | 571 }; |
| 620 | 572 |
| 621 #if defined(COMPILER_MSVC) | 573 #if defined(COMPILER_MSVC) |
| 622 #pragma warning(pop) | 574 #pragma warning(pop) |
| 623 #endif | 575 #endif |
| 624 | 576 |
| 625 } // namespace content | 577 } // namespace content |
| 626 | 578 |
| 627 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 579 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| OLD | NEW |