Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/common/navigation_params.h

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/navigation_gesture.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 "ui/base/page_transition_types.h" 24 #include "ui/base/page_transition_types.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 26
27 namespace content { 27 namespace content {
28 28
29 // The LoFi state which determines whether to add the Lo-Fi header.
30 enum LoFiState {
31 // Let the browser process decide whether or not to request the Lo-Fi version.
32 LOFI_UNSPECIFIED = 0,
33
34 // Request a normal (non-Lo-Fi) version of the resource.
35 LOFI_OFF,
36
37 // Request a Lo-Fi version of the resource.
38 LOFI_ON,
39 };
40
41 // PlzNavigate 29 // PlzNavigate
42 // Helper function to determine if the navigation to |url| should make a request 30 // Helper function to determine if the navigation to |url| should make a request
43 // to the network stack. A request should not be sent for JavaScript URLs or 31 // to the network stack. A request should not be sent for JavaScript URLs or
44 // about:blank. In these cases, no request needs to be sent. 32 // about:blank. In these cases, no request needs to be sent.
45 bool CONTENT_EXPORT ShouldMakeNetworkRequestForURL(const GURL& url); 33 bool CONTENT_EXPORT ShouldMakeNetworkRequestForURL(const GURL& url);
46 34
47 // The following structures hold parameters used during a navigation. In 35 // The following structures hold parameters used during a navigation. In
48 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and 36 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and
49 // FrameHostMsg_BeginNavigation. 37 // FrameHostMsg_BeginNavigation.
50 38
51 // Provided by the browser or the renderer ------------------------------------- 39 // Provided by the browser or the renderer -------------------------------------
52 40
53 // Used by all navigation IPCs. 41 // Used by all navigation IPCs.
54 struct CONTENT_EXPORT CommonNavigationParams { 42 struct CONTENT_EXPORT CommonNavigationParams {
55 CommonNavigationParams(); 43 CommonNavigationParams();
56 CommonNavigationParams( 44 CommonNavigationParams(
57 const GURL& url, 45 const GURL& url,
58 const Referrer& referrer, 46 const Referrer& referrer,
59 ui::PageTransition transition, 47 ui::PageTransition transition,
60 FrameMsg_Navigate_Type::Value navigation_type, 48 FrameMsg_Navigate_Type::Value navigation_type,
61 NavigationGesture gesture, 49 NavigationGesture gesture,
62 bool allow_download, 50 bool allow_download,
63 bool should_replace_current_entry, 51 bool should_replace_current_entry,
64 base::TimeTicks ui_timestamp, 52 base::TimeTicks ui_timestamp,
65 FrameMsg_UILoadMetricsReportType::Value report_type, 53 FrameMsg_UILoadMetricsReportType::Value report_type,
66 const GURL& base_url_for_data_url, 54 const GURL& base_url_for_data_url,
67 const GURL& history_url_for_data_url, 55 const GURL& history_url_for_data_url,
68 LoFiState lofi_state, 56 int previews_state,
69 const base::TimeTicks& navigation_start, 57 const base::TimeTicks& navigation_start,
70 std::string method, 58 std::string method,
71 const scoped_refptr<ResourceRequestBodyImpl>& post_data); 59 const scoped_refptr<ResourceRequestBodyImpl>& post_data);
72 CommonNavigationParams(const CommonNavigationParams& other); 60 CommonNavigationParams(const CommonNavigationParams& other);
73 ~CommonNavigationParams(); 61 ~CommonNavigationParams();
74 62
75 // The URL to navigate to. 63 // The URL to navigate to.
76 // PlzNavigate: May be modified when the navigation is ready to commit. 64 // PlzNavigate: May be modified when the navigation is ready to commit.
77 GURL url; 65 GURL url;
78 66
(...skipping 30 matching lines...) Expand all
109 FrameMsg_UILoadMetricsReportType::Value report_type; 97 FrameMsg_UILoadMetricsReportType::Value report_type;
110 98
111 // Base URL for use in Blink's SubstituteData. 99 // Base URL for use in Blink's SubstituteData.
112 // Is only used with data: URLs. 100 // Is only used with data: URLs.
113 GURL base_url_for_data_url; 101 GURL base_url_for_data_url;
114 102
115 // History URL for use in Blink's SubstituteData. 103 // History URL for use in Blink's SubstituteData.
116 // Is only used with data: URLs. 104 // Is only used with data: URLs.
117 GURL history_url_for_data_url; 105 GURL history_url_for_data_url;
118 106
119 // Whether or not to request a LoFi version of the document or let the browser 107 // Bitmask that has whether or not to request a Preview version of the
120 // decide. 108 // document for various preview types or let the browser decide.
121 LoFiState lofi_state; 109 int previews_state;
122 110
123 // The navigationStart time exposed through the Navigation Timing API to JS. 111 // The navigationStart time exposed through the Navigation Timing API to JS.
124 // If this is for a browser-initiated navigation, this can override the 112 // If this is for a browser-initiated navigation, this can override the
125 // navigation_start value in Blink. 113 // navigation_start value in Blink.
126 // PlzNavigate: For renderer initiated navigations, this will be set on the 114 // PlzNavigate: For renderer initiated navigations, this will be set on the
127 // renderer side and sent with FrameHostMsg_BeginNavigation. 115 // renderer side and sent with FrameHostMsg_BeginNavigation.
128 base::TimeTicks navigation_start; 116 base::TimeTicks navigation_start;
129 117
130 // The request method: GET, POST, etc. 118 // The request method: GET, POST, etc.
131 std::string method; 119 std::string method;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 ~NavigationParams(); 335 ~NavigationParams();
348 336
349 CommonNavigationParams common_params; 337 CommonNavigationParams common_params;
350 StartNavigationParams start_params; 338 StartNavigationParams start_params;
351 RequestNavigationParams request_params; 339 RequestNavigationParams request_params;
352 }; 340 };
353 341
354 } // namespace content 342 } // namespace content
355 343
356 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ 344 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698