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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // user decided the navigation should proceed should be passed as | 270 // user decided the navigation should proceed should be passed as |
271 // |proceed_time|. | 271 // |proceed_time|. |
272 void SetNavigationsSuspended(bool suspend, | 272 void SetNavigationsSuspended(bool suspend, |
273 const base::TimeTicks& proceed_time); | 273 const base::TimeTicks& proceed_time); |
274 | 274 |
275 // Clears any suspended navigation state after a cross-site navigation is | 275 // Clears any suspended navigation state after a cross-site navigation is |
276 // canceled or suspended. This is important if we later return to this | 276 // canceled or suspended. This is important if we later return to this |
277 // RenderViewHost. | 277 // RenderViewHost. |
278 void CancelSuspendedNavigations(); | 278 void CancelSuspendedNavigations(); |
279 | 279 |
| 280 // Whether the initial empty page of this view has been accessed by another |
| 281 // page, making it unsafe to show the pending URL. Always false after the |
| 282 // first commit. |
| 283 bool has_accessed_initial_document() { |
| 284 return has_accessed_initial_document_; |
| 285 } |
| 286 |
280 // 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 |
281 // different process. | 288 // different process. |
282 bool is_swapped_out() const { return is_swapped_out_; } | 289 bool is_swapped_out() const { return is_swapped_out_; } |
283 | 290 |
284 // Tells the renderer that this RenderView is being swapped out for one in a | 291 // Tells the renderer that this RenderView is being swapped out for one in a |
285 // different renderer process. It should run its unload handler and move to | 292 // different renderer process. It should run its unload handler and move to |
286 // a blank document. The renderer should preserve the Frame object until it | 293 // a blank document. The renderer should preserve the Frame object until it |
287 // exits, in case we come back. The renderer can exit if it has no other | 294 // exits, in case we come back. The renderer can exit if it has no other |
288 // active RenderViews, but not until WasSwappedOut is called (when it is no | 295 // active RenderViews, but not until WasSwappedOut is called (when it is no |
289 // longer visible). | 296 // longer visible). |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 void OnMediaNotification(int64 player_cookie, | 561 void OnMediaNotification(int64 player_cookie, |
555 bool has_video, | 562 bool has_video, |
556 bool has_audio, | 563 bool has_audio, |
557 bool is_playing); | 564 bool is_playing); |
558 void OnRequestDesktopNotificationPermission(const GURL& origin, | 565 void OnRequestDesktopNotificationPermission(const GURL& origin, |
559 int callback_id); | 566 int callback_id); |
560 void OnShowDesktopNotification( | 567 void OnShowDesktopNotification( |
561 const ShowDesktopNotificationHostMsgParams& params); | 568 const ShowDesktopNotificationHostMsgParams& params); |
562 void OnCancelDesktopNotification(int notification_id); | 569 void OnCancelDesktopNotification(int notification_id); |
563 void OnRunFileChooser(const FileChooserParams& params); | 570 void OnRunFileChooser(const FileChooserParams& params); |
| 571 void OnDidAccessInitialDocument(); |
564 void OnDomOperationResponse(const std::string& json_string, | 572 void OnDomOperationResponse(const std::string& json_string, |
565 int automation_id); | 573 int automation_id); |
566 void OnGetWindowSnapshot(const int snapshot_id); | 574 void OnGetWindowSnapshot(const int snapshot_id); |
567 | 575 |
568 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 576 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
569 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 577 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
570 #endif | 578 #endif |
571 | 579 |
572 private: | 580 private: |
573 friend class TestRenderViewHost; | 581 friend class TestRenderViewHost; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // request, until we hear back from the onbeforeunload handler of the old | 623 // request, until we hear back from the onbeforeunload handler of the old |
616 // RenderViewHost. | 624 // RenderViewHost. |
617 bool navigations_suspended_; | 625 bool navigations_suspended_; |
618 | 626 |
619 // We only buffer the params for a suspended navigation while we have a | 627 // We only buffer the params for a suspended navigation while we have a |
620 // pending RVH for a WebContentsImpl. There will only ever be one suspended | 628 // pending RVH for a WebContentsImpl. There will only ever be one suspended |
621 // navigation, because WebContentsImpl will destroy the pending RVH and create | 629 // navigation, because WebContentsImpl will destroy the pending RVH and create |
622 // a new one if a second navigation occurs. | 630 // a new one if a second navigation occurs. |
623 scoped_ptr<ViewMsg_Navigate_Params> suspended_nav_params_; | 631 scoped_ptr<ViewMsg_Navigate_Params> suspended_nav_params_; |
624 | 632 |
| 633 // Whether the initial empty page of this view has been accessed by another |
| 634 // page, making it unsafe to show the pending URL. Usually false unless |
| 635 // another window tries to modify the blank page. Always false after the |
| 636 // first commit. |
| 637 bool has_accessed_initial_document_; |
| 638 |
625 // Whether this RenderViewHost is currently swapped out, such that the view is | 639 // Whether this RenderViewHost is currently swapped out, such that the view is |
626 // being rendered by another process. | 640 // being rendered by another process. |
627 bool is_swapped_out_; | 641 bool is_swapped_out_; |
628 | 642 |
629 // Whether this RenderView is responsible for displaying a subframe in a | 643 // Whether this RenderView is responsible for displaying a subframe in a |
630 // different process from its parent page. | 644 // different process from its parent page. |
631 bool is_subframe_; | 645 bool is_subframe_; |
632 | 646 |
633 // The frame id of the main (top level) frame. This value is set on the | 647 // The frame id of the main (top level) frame. This value is set on the |
634 // initial navigation of a RenderView and reset when the RenderView is | 648 // initial navigation of a RenderView and reset when the RenderView is |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 722 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
709 }; | 723 }; |
710 | 724 |
711 #if defined(COMPILER_MSVC) | 725 #if defined(COMPILER_MSVC) |
712 #pragma warning(pop) | 726 #pragma warning(pop) |
713 #endif | 727 #endif |
714 | 728 |
715 } // namespace content | 729 } // namespace content |
716 | 730 |
717 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 731 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |