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/time/time.h" | 14 #include "base/time/time.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/frame_message_enums.h" | 17 #include "content/common/frame_message_enums.h" |
| 18 #include "content/common/navigation_gesture.h" |
18 #include "content/common/resource_request_body_impl.h" | 19 #include "content/common/resource_request_body_impl.h" |
19 #include "content/public/common/page_state.h" | 20 #include "content/public/common/page_state.h" |
20 #include "content/public/common/referrer.h" | 21 #include "content/public/common/referrer.h" |
21 #include "content/public/common/request_context_type.h" | 22 #include "content/public/common/request_context_type.h" |
22 #include "content/public/common/resource_response.h" | 23 #include "content/public/common/resource_response.h" |
23 #include "ui/base/page_transition_types.h" | 24 #include "ui/base/page_transition_types.h" |
24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 | 28 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 138 |
138 // This struct is not used outside of the PlzNavigate project. | 139 // This struct is not used outside of the PlzNavigate project. |
139 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 140 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
140 // following a renderer-initiated navigation request. | 141 // following a renderer-initiated navigation request. |
141 struct CONTENT_EXPORT BeginNavigationParams { | 142 struct CONTENT_EXPORT BeginNavigationParams { |
142 // TODO(clamy): See if it is possible to reuse this in | 143 // TODO(clamy): See if it is possible to reuse this in |
143 // ResourceMsg_Request_Params. | 144 // ResourceMsg_Request_Params. |
144 BeginNavigationParams(); | 145 BeginNavigationParams(); |
145 BeginNavigationParams(std::string headers, | 146 BeginNavigationParams(std::string headers, |
146 int load_flags, | 147 int load_flags, |
147 bool has_user_gesture, | 148 NavigationGesture gesture, |
148 bool skip_service_worker, | 149 bool skip_service_worker, |
149 RequestContextType request_context_type); | 150 RequestContextType request_context_type); |
150 BeginNavigationParams(const BeginNavigationParams& other); | 151 BeginNavigationParams(const BeginNavigationParams& other); |
151 | 152 |
152 // Additional HTTP request headers. | 153 // Additional HTTP request headers. |
153 std::string headers; | 154 std::string headers; |
154 | 155 |
155 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 156 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
156 int load_flags; | 157 int load_flags; |
157 | 158 |
158 // True if the request was user initiated. | 159 // Indicates the gesture type. |
159 bool has_user_gesture; | 160 NavigationGesture gesture; |
160 | 161 |
161 // True if the ServiceWorker should be skipped. | 162 // True if the ServiceWorker should be skipped. |
162 bool skip_service_worker; | 163 bool skip_service_worker; |
163 | 164 |
164 // Indicates the request context type. | 165 // Indicates the request context type. |
165 RequestContextType request_context_type; | 166 RequestContextType request_context_type; |
166 | 167 |
167 // See WebSearchableFormData for a description of these. | 168 // See WebSearchableFormData for a description of these. |
168 GURL searchable_form_url; | 169 GURL searchable_form_url; |
169 std::string searchable_form_encoding; | 170 std::string searchable_form_encoding; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bool is_same_document_history_load, | 227 bool is_same_document_history_load, |
227 bool is_history_navigation_in_new_child, | 228 bool is_history_navigation_in_new_child, |
228 std::map<std::string, bool> subframe_unique_names, | 229 std::map<std::string, bool> subframe_unique_names, |
229 bool has_committed_real_load, | 230 bool has_committed_real_load, |
230 bool intended_as_new_entry, | 231 bool intended_as_new_entry, |
231 int pending_history_list_offset, | 232 int pending_history_list_offset, |
232 int current_history_list_offset, | 233 int current_history_list_offset, |
233 int current_history_list_length, | 234 int current_history_list_length, |
234 bool is_view_source, | 235 bool is_view_source, |
235 bool should_clear_history_list, | 236 bool should_clear_history_list, |
236 bool has_user_gesture); | 237 NavigationGesture gesture); |
237 RequestNavigationParams(const RequestNavigationParams& other); | 238 RequestNavigationParams(const RequestNavigationParams& other); |
238 ~RequestNavigationParams(); | 239 ~RequestNavigationParams(); |
239 | 240 |
240 // Whether or not the user agent override string should be used. | 241 // Whether or not the user agent override string should be used. |
241 bool is_overriding_user_agent; | 242 bool is_overriding_user_agent; |
242 | 243 |
243 // Any redirect URLs that occurred before |url|. Useful for cross-process | 244 // Any redirect URLs that occurred before |url|. Useful for cross-process |
244 // navigations; defaults to empty. | 245 // navigations; defaults to empty. |
245 std::vector<GURL> redirects; | 246 std::vector<GURL> redirects; |
246 | 247 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // Timing of navigation events. | 319 // Timing of navigation events. |
319 NavigationTiming navigation_timing; | 320 NavigationTiming navigation_timing; |
320 | 321 |
321 // PlzNavigate | 322 // PlzNavigate |
322 // The ServiceWorkerProviderHost ID used for navigations, if it was already | 323 // The ServiceWorkerProviderHost ID used for navigations, if it was already |
323 // created by the browser. Set to kInvalidServiceWorkerProviderId otherwise. | 324 // created by the browser. Set to kInvalidServiceWorkerProviderId otherwise. |
324 // This parameter is not used in the current navigation architecture, where | 325 // This parameter is not used in the current navigation architecture, where |
325 // it will always be equal to kInvalidServiceWorkerProviderId. | 326 // it will always be equal to kInvalidServiceWorkerProviderId. |
326 int service_worker_provider_id; | 327 int service_worker_provider_id; |
327 | 328 |
328 // True if the navigation originated due to a user gesture. | 329 // Indicates the gesture type. |
329 bool has_user_gesture; | 330 NavigationGesture gesture; |
330 | 331 |
331 #if defined(OS_ANDROID) | 332 #if defined(OS_ANDROID) |
332 // The real content of the data: URL. Only used in Android WebView for | 333 // The real content of the data: URL. Only used in Android WebView for |
333 // implementing LoadDataWithBaseUrl API method to circumvent the restriction | 334 // implementing LoadDataWithBaseUrl API method to circumvent the restriction |
334 // on the GURL max length in the IPC layer. Short data: URLs can still be | 335 // on the GURL max length in the IPC layer. Short data: URLs can still be |
335 // passed in the |CommonNavigationParams::url| field. | 336 // passed in the |CommonNavigationParams::url| field. |
336 std::string data_url_as_string; | 337 std::string data_url_as_string; |
337 #endif | 338 #endif |
338 }; | 339 }; |
339 | 340 |
340 // Helper struct keeping track in one place of all the parameters the browser | 341 // Helper struct keeping track in one place of all the parameters the browser |
341 // needs to provide to the renderer. | 342 // needs to provide to the renderer. |
342 struct NavigationParams { | 343 struct NavigationParams { |
343 NavigationParams(const CommonNavigationParams& common_params, | 344 NavigationParams(const CommonNavigationParams& common_params, |
344 const StartNavigationParams& start_params, | 345 const StartNavigationParams& start_params, |
345 const RequestNavigationParams& request_params); | 346 const RequestNavigationParams& request_params); |
346 ~NavigationParams(); | 347 ~NavigationParams(); |
347 | 348 |
348 CommonNavigationParams common_params; | 349 CommonNavigationParams common_params; |
349 StartNavigationParams start_params; | 350 StartNavigationParams start_params; |
350 RequestNavigationParams request_params; | 351 RequestNavigationParams request_params; |
351 }; | 352 }; |
352 | 353 |
353 } // namespace content | 354 } // namespace content |
354 | 355 |
355 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 356 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |