OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_COMMON_NAVIGATION_PARAMS_H_ | 5 #ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/optional.h" | 14 #include "base/optional.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "content/common/frame_message_enums.h" | 18 #include "content/common/frame_message_enums.h" |
19 #include "content/common/resource_request_body_impl.h" | 19 #include "content/common/resource_request_body_impl.h" |
20 #include "content/public/common/page_state.h" | 20 #include "content/public/common/page_state.h" |
21 #include "content/public/common/referrer.h" | 21 #include "content/public/common/referrer.h" |
22 #include "content/public/common/request_context_type.h" | 22 #include "content/public/common/request_context_type.h" |
23 #include "content/public/common/resource_response.h" | 23 #include "content/public/common/resource_response.h" |
| 24 #include "third_party/WebKit/public/platform/WebMixedContent.h" |
24 #include "ui/base/page_transition_types.h" | 25 #include "ui/base/page_transition_types.h" |
25 #include "url/gurl.h" | 26 #include "url/gurl.h" |
26 #include "url/origin.h" | 27 #include "url/origin.h" |
27 | 28 |
28 namespace content { | 29 namespace content { |
29 | 30 |
30 // The LoFi state which determines whether to add the Lo-Fi header. | 31 // The LoFi state which determines whether to add the Lo-Fi header. |
31 enum LoFiState { | 32 enum LoFiState { |
32 // Let the browser process decide whether or not to request the Lo-Fi version. | 33 // Let the browser process decide whether or not to request the Lo-Fi version. |
33 LOFI_UNSPECIFIED = 0, | 34 LOFI_UNSPECIFIED = 0, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // used in PlzNavigate (since in the current architecture, the renderer does not | 138 // used in PlzNavigate (since in the current architecture, the renderer does not |
138 // inform the browser of navigations until they commit). | 139 // inform the browser of navigations until they commit). |
139 | 140 |
140 // This struct is not used outside of the PlzNavigate project. | 141 // This struct is not used outside of the PlzNavigate project. |
141 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 142 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
142 // following a renderer-initiated navigation request. | 143 // following a renderer-initiated navigation request. |
143 struct CONTENT_EXPORT BeginNavigationParams { | 144 struct CONTENT_EXPORT BeginNavigationParams { |
144 // TODO(clamy): See if it is possible to reuse this in | 145 // TODO(clamy): See if it is possible to reuse this in |
145 // ResourceMsg_Request_Params. | 146 // ResourceMsg_Request_Params. |
146 BeginNavigationParams(); | 147 BeginNavigationParams(); |
147 BeginNavigationParams(std::string headers, | 148 BeginNavigationParams( |
148 int load_flags, | 149 std::string headers, |
149 bool has_user_gesture, | 150 int load_flags, |
150 bool skip_service_worker, | 151 bool has_user_gesture, |
151 RequestContextType request_context_type, | 152 bool skip_service_worker, |
152 const base::Optional<url::Origin>& initiator_origin); | 153 RequestContextType request_context_type, |
| 154 blink::WebMixedContent::ContextType mixed_content_context_type, |
| 155 const base::Optional<url::Origin>& initiator_origin); |
153 BeginNavigationParams(const BeginNavigationParams& other); | 156 BeginNavigationParams(const BeginNavigationParams& other); |
154 ~BeginNavigationParams(); | 157 ~BeginNavigationParams(); |
155 | 158 |
156 // Additional HTTP request headers. | 159 // Additional HTTP request headers. |
157 std::string headers; | 160 std::string headers; |
158 | 161 |
159 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 162 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
160 int load_flags; | 163 int load_flags; |
161 | 164 |
162 // True if the request was user initiated. | 165 // True if the request was user initiated. |
163 bool has_user_gesture; | 166 bool has_user_gesture; |
164 | 167 |
165 // True if the ServiceWorker should be skipped. | 168 // True if the ServiceWorker should be skipped. |
166 bool skip_service_worker; | 169 bool skip_service_worker; |
167 | 170 |
168 // Indicates the request context type. | 171 // Indicates the request context type. |
169 RequestContextType request_context_type; | 172 RequestContextType request_context_type; |
170 | 173 |
| 174 // The mixed content context type for potential mixed content checks. |
| 175 blink::WebMixedContent::ContextType mixed_content_context_type; |
| 176 |
171 // See WebSearchableFormData for a description of these. | 177 // See WebSearchableFormData for a description of these. |
172 GURL searchable_form_url; | 178 GURL searchable_form_url; |
173 std::string searchable_form_encoding; | 179 std::string searchable_form_encoding; |
174 | 180 |
175 // Indicates the initiator of the request. In auxilliary navigations, this is | 181 // Indicates the initiator of the request. In auxilliary navigations, this is |
176 // the origin of the document that triggered the navigation. This parameter | 182 // the origin of the document that triggered the navigation. This parameter |
177 // can be null during browser-initiated navigations. | 183 // can be null during browser-initiated navigations. |
178 base::Optional<url::Origin> initiator_origin; | 184 base::Optional<url::Origin> initiator_origin; |
179 }; | 185 }; |
180 | 186 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 ~NavigationParams(); | 365 ~NavigationParams(); |
360 | 366 |
361 CommonNavigationParams common_params; | 367 CommonNavigationParams common_params; |
362 StartNavigationParams start_params; | 368 StartNavigationParams start_params; |
363 RequestNavigationParams request_params; | 369 RequestNavigationParams request_params; |
364 }; | 370 }; |
365 | 371 |
366 } // namespace content | 372 } // namespace content |
367 | 373 |
368 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 374 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |