Index: content/common/navigation_params.h |
diff --git a/content/common/navigation_params.h b/content/common/navigation_params.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5a09657af9034c2a0155f665860794ac1c5b3861 |
--- /dev/null |
+++ b/content/common/navigation_params.h |
@@ -0,0 +1,94 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
+#define CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
+ |
+#include <string> |
+ |
+#include "base/basictypes.h" |
+#include "base/time/time.h" |
+#include "content/common/frame_message_enums.h" |
+#include "content/public/common/page_state.h" |
+#include "content/public/common/page_transition_types.h" |
+#include "content/public/common/referrer.h" |
+#include "url/gurl.h" |
+ |
+namespace content { |
+ |
+// The following structures hold parameters used during a navigation. In |
+// particular, FrameMsg_Navigate_Params, FrameMsg_CommitNavigation_Params and |
+// FrameHostMsg_BeginNavigation_Params are subclasses of these structures. |
+struct CoreNavigationParams { |
+ CoreNavigationParams(); |
+ ~CoreNavigationParams(); |
+ // The URL to navigate to. |
+ // PlzNavigate: May be modified when the navigation is ready to commit. |
+ GURL url; |
+ |
+ // The URL to send in the "Referer" header field. Can be empty if there is |
+ // no referrer. |
+ Referrer referrer; |
+ |
+ // The type of transition. |
+ PageTransition transition; |
+}; |
+ |
+struct NavigationParamsWithCommitInfo : CoreNavigationParams { |
Charlie Reis
2014/09/15 21:19:40
Please add a comment saying what stage(s) of navig
|
+ NavigationParamsWithCommitInfo(); |
+ ~NavigationParamsWithCommitInfo(); |
+ // The page_id for this navigation, or -1 if it is a new navigation. Back, |
+ // Forward, and Reload navigations should have a valid page_id. If the load |
+ // succeeds, then this page_id will be reflected in the resultant |
+ // FrameHostMsg_DidCommitProvisionalLoad message. |
+ int32 page_id; |
+ |
+ // Informs the RenderView the session history should be cleared. In that |
+ // case, the RenderView needs to notify the browser that the clearing was |
+ // succesful when the navigation commits. |
+ bool should_clear_history_list; |
+ |
+ // If page_id is -1, then pending_history_list_offset will also be -1. |
+ // Otherwise, it contains the offset into the history list corresponding to |
+ // the current navigation. |
+ int pending_history_list_offset; |
+ |
+ // Used to inform the RenderFrame of where its current page contents reside in |
+ // session history and the total size of the session history list. |
+ int current_history_list_offset; |
+ int current_history_list_length; |
+ |
+ // Opaque history state (received by ViewHostMsg_UpdateState). |
+ PageState page_state; |
+ |
+ // Type of navigation. |
+ FrameMsg_Navigate_Type::Value navigation_type; |
+ |
+ // Whether or not the user agent override string should be used. |
+ bool is_overriding_user_agent; |
+ |
+ // The navigationStart time to expose through the Navigation Timing API to JS. |
+ base::TimeTicks browser_navigation_start; |
+}; |
+ |
+struct NavigationParamsWithRequestAndCommitInfo : |
Charlie Reis
2014/09/15 21:19:40
Please add a comment saying when this is used.
At
|
+ NavigationParamsWithCommitInfo { |
+ NavigationParamsWithRequestAndCommitInfo(); |
+ ~NavigationParamsWithRequestAndCommitInfo(); |
+ bool is_post; |
Charlie Reis
2014/09/15 21:19:40
Please add a comment here.
|
+ |
+ // Whether or not we should allow the URL to download. |
Charlie Reis
2014/09/15 21:19:40
As noted before, what if it's not a download? (An
|
+ bool allow_download; |
+ |
+ // Extra headers (separated by \n) to send during the request. |
+ std::string extra_headers; |
+ |
+ // If is_post is true, holds the post_data information from browser. Empty |
+ // otherwise. |
+ std::vector<unsigned char> browser_initiated_post_data; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |