Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_ | |
| 6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/time/time.h" | |
| 12 #include "content/common/content_export.h" | |
| 13 #include "content/common/frame_message_enums.h" | |
| 14 #include "content/public/common/page_state.h" | |
| 15 #include "content/public/common/referrer.h" | |
| 16 #include "ui/base/page_transition_types.h" | |
| 17 #include "url/gurl.h" | |
| 18 | |
| 19 namespace base { | |
| 20 class RefCountedMemory; | |
| 21 } | |
| 22 | |
| 23 namespace content { | |
| 24 class NavigationEntry; | |
| 25 | |
| 26 // The following structures hold parameters used during a navigation. In | |
| 27 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and | |
| 28 // FrameHostMsg_BeginNavigation. | |
| 29 | |
| 30 // Used by all navigation IPCs. | |
| 31 struct CONTENT_EXPORT CoreNavigationParams { | |
| 32 CoreNavigationParams(); | |
| 33 CoreNavigationParams(const GURL& url, | |
| 34 const Referrer& referrer, | |
| 35 ui::PageTransition transition, | |
| 36 FrameMsg_Navigate_Type::Value navigation_type, | |
| 37 bool allow_download); | |
| 38 ~CoreNavigationParams(); | |
| 39 | |
| 40 // The URL to navigate to. | |
| 41 // PlzNavigate: May be modified when the navigation is ready to commit. | |
| 42 GURL url; | |
| 43 | |
| 44 // The URL to send in the "Referer" header field. Can be empty if there is | |
| 45 // no referrer. | |
| 46 Referrer referrer; | |
| 47 | |
| 48 // The type of transition. | |
| 49 ui::PageTransition transition; | |
| 50 | |
| 51 // Type of navigation. | |
| 52 FrameMsg_Navigate_Type::Value navigation_type; | |
| 53 | |
| 54 // Allows the URL to be downloaded (true by default). | |
| 55 // Avoid downloading when in view-source mode. | |
| 56 bool allow_download; | |
| 57 }; | |
| 58 | |
| 59 // Used by FrameMsg_Navigate. | |
| 60 // PlzNavigate: sent to the renderer when requesting a navigation. | |
| 61 struct CONTENT_EXPORT RequestNavigationParams { | |
| 62 RequestNavigationParams(); | |
| 63 RequestNavigationParams(bool is_post, | |
| 64 const std::string& extra_headers, | |
| 65 const base::RefCountedMemory* post_data); | |
| 66 ~RequestNavigationParams(); | |
| 67 | |
| 68 // Whether the navigation is a POST request (as opposed to a GET). | |
| 69 bool is_post; | |
| 70 | |
| 71 // Extra headers (separated by \n) to send during the request. | |
| 72 std::string extra_headers; | |
| 73 | |
| 74 // If is_post is true, holds the post_data information from browser. Empty | |
| 75 // otherwise. | |
| 76 std::vector<unsigned char> browser_initiated_post_data; | |
| 77 }; | |
| 78 | |
| 79 // Used by FrameMsg_Navigate. | |
| 80 // PlzNavigate: sent to the renderer when the navigation is ready to commit. | |
| 81 struct CONTENT_EXPORT CommitNavigationParams { | |
| 82 CommitNavigationParams(); | |
| 83 CommitNavigationParams(const PageState& page_state, | |
| 84 bool is_overriding_user_agent, | |
| 85 base::TimeTicks navigation_start); | |
| 86 ~CommitNavigationParams(); | |
|
clamy
2014/09/23 21:13:26
I removed the history parameters from CommitNaviga
nasko
2014/09/24 22:42:15
How would history work in the PlzNavigate world th
clamy
2014/09/26 17:22:32
Honestly I am not sure. It would be a lot better i
| |
| 87 | |
| 88 // Opaque history state (received by ViewHostMsg_UpdateState). | |
| 89 PageState page_state; | |
| 90 | |
| 91 // Whether or not the user agent override string should be used. | |
| 92 bool is_overriding_user_agent; | |
| 93 | |
| 94 // The navigationStart time to expose through the Navigation Timing API to JS. | |
| 95 base::TimeTicks browser_navigation_start; | |
| 96 }; | |
| 97 | |
| 98 } // namespace content | |
| 99 | |
| 100 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | |
| OLD | NEW |