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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/common/frame_message_enums.h" | 13 #include "content/common/frame_message_enums.h" |
14 #include "content/public/common/page_state.h" | 14 #include "content/public/common/page_state.h" |
15 #include "content/public/common/referrer.h" | 15 #include "content/public/common/referrer.h" |
16 #include "ui/base/page_transition_types.h" | 16 #include "ui/base/page_transition_types.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class RefCountedMemory; | 20 class RefCountedMemory; |
21 } | 21 } |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
| 25 // The LoFi state which determines whether to add the LoFi header. Must stay in |
| 26 // sync with the enum in url_request.h. |
| 27 enum LoFiState { |
| 28 // Request a LoFi version of the resource. |
| 29 LOFI_ON = 0, |
| 30 // Request a normal (non-LoFi) version of the resource. |
| 31 LOFI_OFF, |
| 32 // Let the browser process decide whether or not to request the LoFi version. |
| 33 LOFI_DEFAULT, |
| 34 }; |
| 35 |
25 // PlzNavigate | 36 // PlzNavigate |
26 // Helper function to determine if the navigation to |url| should make a request | 37 // Helper function to determine if the navigation to |url| should make a request |
27 // to the network stack. A request should not be sent for data URLs, JavaScript | 38 // to the network stack. A request should not be sent for data URLs, JavaScript |
28 // URLs or about:blank. In these cases, no request needs to be sent. | 39 // URLs or about:blank. In these cases, no request needs to be sent. |
29 bool ShouldMakeNetworkRequestForURL(const GURL& url); | 40 bool ShouldMakeNetworkRequestForURL(const GURL& url); |
30 | 41 |
31 // The following structures hold parameters used during a navigation. In | 42 // The following structures hold parameters used during a navigation. In |
32 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and | 43 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and |
33 // FrameHostMsg_BeginNavigation. | 44 // FrameHostMsg_BeginNavigation. |
34 | 45 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 261 |
251 // Where its current page contents reside in session history and the total | 262 // Where its current page contents reside in session history and the total |
252 // size of the session history list. | 263 // size of the session history list. |
253 int current_history_list_offset; | 264 int current_history_list_offset; |
254 int current_history_list_length; | 265 int current_history_list_length; |
255 | 266 |
256 // Whether session history should be cleared. In that case, the RenderView | 267 // Whether session history should be cleared. In that case, the RenderView |
257 // needs to notify the browser that the clearing was succesful when the | 268 // needs to notify the browser that the clearing was succesful when the |
258 // navigation commits. | 269 // navigation commits. |
259 bool should_clear_history_list; | 270 bool should_clear_history_list; |
| 271 |
| 272 // Whether or not to request a LoFi version of the document or let the browser |
| 273 // decide. |
| 274 LoFiState lofi_state; |
260 }; | 275 }; |
261 | 276 |
262 // Helper struct keeping track in one place of all the parameters the browser | 277 // Helper struct keeping track in one place of all the parameters the browser |
263 // needs to provide to the renderer. | 278 // needs to provide to the renderer. |
264 struct NavigationParams { | 279 struct NavigationParams { |
265 NavigationParams(const CommonNavigationParams& common_params, | 280 NavigationParams(const CommonNavigationParams& common_params, |
266 const StartNavigationParams& start_params, | 281 const StartNavigationParams& start_params, |
267 const RequestNavigationParams& request_params); | 282 const RequestNavigationParams& request_params); |
268 ~NavigationParams(); | 283 ~NavigationParams(); |
269 | 284 |
270 CommonNavigationParams common_params; | 285 CommonNavigationParams common_params; |
271 StartNavigationParams start_params; | 286 StartNavigationParams start_params; |
272 RequestNavigationParams request_params; | 287 RequestNavigationParams request_params; |
273 }; | 288 }; |
274 | 289 |
275 } // namespace content | 290 } // namespace content |
276 | 291 |
277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 292 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |