OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 class SpeechInputDispatcher; | 72 class SpeechInputDispatcher; |
73 struct ViewHostMsg_RunFileChooser_Params; | 73 struct ViewHostMsg_RunFileChooser_Params; |
74 struct ViewMsg_Navigate_Params; | 74 struct ViewMsg_Navigate_Params; |
75 struct ViewMsg_StopFinding_Params; | 75 struct ViewMsg_StopFinding_Params; |
76 struct ViewMsg_SwapOut_Params; | 76 struct ViewMsg_SwapOut_Params; |
77 struct WebDropData; | 77 struct WebDropData; |
78 class WebPluginDelegateProxy; | 78 class WebPluginDelegateProxy; |
79 class WebUIBindings; | 79 class WebUIBindings; |
80 | 80 |
81 namespace content { | 81 namespace content { |
82 class RenderViewTest; | 82 class DocumentState; |
83 class NavigationState; | |
84 class P2PSocketDispatcher; | 83 class P2PSocketDispatcher; |
85 class RenderViewObserver; | 84 class RenderViewObserver; |
| 85 class RenderViewTest; |
86 } // namespace content | 86 } // namespace content |
87 | 87 |
88 namespace gfx { | 88 namespace gfx { |
89 class Point; | 89 class Point; |
90 class Rect; | 90 class Rect; |
91 } // namespace gfx | 91 } // namespace gfx |
92 | 92 |
93 namespace webkit { | 93 namespace webkit { |
94 | 94 |
95 namespace ppapi { | 95 namespace ppapi { |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 | 900 |
901 // Returns false unless this is a top-level navigation that crosses origins. | 901 // Returns false unless this is a top-level navigation that crosses origins. |
902 bool IsNonLocalTopLevelNavigation(const GURL& url, | 902 bool IsNonLocalTopLevelNavigation(const GURL& url, |
903 WebKit::WebFrame* frame, | 903 WebKit::WebFrame* frame, |
904 WebKit::WebNavigationType type); | 904 WebKit::WebNavigationType type); |
905 | 905 |
906 bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame, | 906 bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame, |
907 const WebKit::WebURLError& error, | 907 const WebKit::WebURLError& error, |
908 bool replace); | 908 bool replace); |
909 | 909 |
| 910 // If we initiated a navigation, this function will populate |document_state| |
| 911 // with the navigation information saved in OnNavigate(). |
| 912 void PopulateStateFromPendingNavigationParams( |
| 913 content::DocumentState* document_state); |
| 914 |
910 // Starts nav_state_sync_timer_ if it isn't already running. | 915 // Starts nav_state_sync_timer_ if it isn't already running. |
911 void StartNavStateSyncTimerIfNecessary(); | 916 void StartNavStateSyncTimerIfNecessary(); |
912 | 917 |
913 // Dispatches the current navigation state to the browser. Called on a | 918 // Dispatches the current navigation state to the browser. Called on a |
914 // periodic timer so we don't send too many messages. | 919 // periodic timer so we don't send too many messages. |
915 void SyncNavigationState(); | 920 void SyncNavigationState(); |
916 | 921 |
917 // Dispatches the current state of selection on the webpage to the browser if | 922 // Dispatches the current state of selection on the webpage to the browser if |
918 // it has changed. | 923 // it has changed. |
919 // TODO(varunjain): delete this method once we figure out how to keep | 924 // TODO(varunjain): delete this method once we figure out how to keep |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 // If we are handling a top-level client-side redirect, this tracks the URL | 993 // If we are handling a top-level client-side redirect, this tracks the URL |
989 // of the page that initiated it. Specifically, when a load is committed this | 994 // of the page that initiated it. Specifically, when a load is committed this |
990 // is used to determine if that load originated from a client-side redirect. | 995 // is used to determine if that load originated from a client-side redirect. |
991 // It is empty if there is no top-level client-side redirect. | 996 // It is empty if there is no top-level client-side redirect. |
992 GURL completed_client_redirect_src_; | 997 GURL completed_client_redirect_src_; |
993 | 998 |
994 // Holds state pertaining to a navigation that we initiated. This is held by | 999 // Holds state pertaining to a navigation that we initiated. This is held by |
995 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_ | 1000 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_ |
996 // as a temporary holder for the state until the WebDataSource corresponding | 1001 // as a temporary holder for the state until the WebDataSource corresponding |
997 // to the new navigation is created. See DidCreateDataSource. | 1002 // to the new navigation is created. See DidCreateDataSource. |
998 scoped_ptr<content::NavigationState> pending_navigation_state_; | 1003 scoped_ptr<ViewMsg_Navigate_Params> pending_navigation_params_; |
999 | 1004 |
1000 // Timer used to delay the updating of nav state (see SyncNavigationState). | 1005 // Timer used to delay the updating of nav state (see SyncNavigationState). |
1001 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_; | 1006 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_; |
1002 | 1007 |
1003 // Page IDs ------------------------------------------------------------------ | 1008 // Page IDs ------------------------------------------------------------------ |
1004 // See documentation in content::RenderView. | 1009 // See documentation in content::RenderView. |
1005 int32 page_id_; | 1010 int32 page_id_; |
1006 | 1011 |
1007 // Indicates the ID of the last page that we sent a FrameNavigate to the | 1012 // Indicates the ID of the last page that we sent a FrameNavigate to the |
1008 // browser for. This is used to determine if the most recent transition | 1013 // browser for. This is used to determine if the most recent transition |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 // bunch of stuff, you should probably create a helper class and put your | 1217 // bunch of stuff, you should probably create a helper class and put your |
1213 // data and methods on that to avoid bloating RenderView more. You can | 1218 // data and methods on that to avoid bloating RenderView more. You can |
1214 // use the Observer interface to filter IPC messages and receive frame change | 1219 // use the Observer interface to filter IPC messages and receive frame change |
1215 // notifications. | 1220 // notifications. |
1216 // --------------------------------------------------------------------------- | 1221 // --------------------------------------------------------------------------- |
1217 | 1222 |
1218 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1223 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1219 }; | 1224 }; |
1220 | 1225 |
1221 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1226 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |