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

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

Issue 2378393002: Pass the user_gesture context in the IPC message FrameMsg_CommitNavigation to the renderer. (Closed)
Patch Set: Fix compile failures Created 4 years, 2 months 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 <string> 10 #include <string>
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to 174 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to
175 // start a browser-initiated navigation besides those in CommonNavigationParams. 175 // start a browser-initiated navigation besides those in CommonNavigationParams.
176 // The difference with the RequestNavigationParams below is that they are only 176 // The difference with the RequestNavigationParams below is that they are only
177 // used in the current architecture of navigation, and will not be used by 177 // used in the current architecture of navigation, and will not be used by
178 // PlzNavigate. 178 // PlzNavigate.
179 // PlzNavigate: These are not used. 179 // PlzNavigate: These are not used.
180 struct CONTENT_EXPORT StartNavigationParams { 180 struct CONTENT_EXPORT StartNavigationParams {
181 StartNavigationParams(); 181 StartNavigationParams();
182 StartNavigationParams(const std::string& extra_headers, 182 StartNavigationParams(const std::string& extra_headers,
183 #if defined(OS_ANDROID)
184 bool has_user_gesture,
185 #endif
186 int transferred_request_child_id, 183 int transferred_request_child_id,
187 int transferred_request_request_id); 184 int transferred_request_request_id);
188 StartNavigationParams(const StartNavigationParams& other); 185 StartNavigationParams(const StartNavigationParams& other);
189 ~StartNavigationParams(); 186 ~StartNavigationParams();
190 187
191 // Extra headers (separated by \n) to send during the request. 188 // Extra headers (separated by \n) to send during the request.
192 std::string extra_headers; 189 std::string extra_headers;
193 190
194 #if defined(OS_ANDROID)
195 bool has_user_gesture;
196 #endif
197
198 // The following two members identify a previous request that has been 191 // The following two members identify a previous request that has been
199 // created before this navigation is being transferred to a new process. 192 // created before this navigation is being transferred to a new process.
200 // This serves the purpose of recycling the old request. 193 // This serves the purpose of recycling the old request.
201 // Unless this refers to a transferred navigation, these values are -1 and -1. 194 // Unless this refers to a transferred navigation, these values are -1 and -1.
202 int transferred_request_child_id; 195 int transferred_request_child_id;
203 int transferred_request_request_id; 196 int transferred_request_request_id;
204 }; 197 };
205 198
206 // PlzNavigate 199 // PlzNavigate
207 // Timings collected in the browser during navigation for the 200 // Timings collected in the browser during navigation for the
(...skipping 20 matching lines...) Expand all
228 int nav_entry_id, 221 int nav_entry_id,
229 bool is_same_document_history_load, 222 bool is_same_document_history_load,
230 bool is_history_navigation_in_new_child, 223 bool is_history_navigation_in_new_child,
231 bool has_subtree_history_items, 224 bool has_subtree_history_items,
232 bool has_committed_real_load, 225 bool has_committed_real_load,
233 bool intended_as_new_entry, 226 bool intended_as_new_entry,
234 int pending_history_list_offset, 227 int pending_history_list_offset,
235 int current_history_list_offset, 228 int current_history_list_offset,
236 int current_history_list_length, 229 int current_history_list_length,
237 bool is_view_source, 230 bool is_view_source,
238 bool should_clear_history_list); 231 bool should_clear_history_list,
232 bool has_user_gesture);
239 RequestNavigationParams(const RequestNavigationParams& other); 233 RequestNavigationParams(const RequestNavigationParams& other);
240 ~RequestNavigationParams(); 234 ~RequestNavigationParams();
241 235
242 // Whether or not the user agent override string should be used. 236 // Whether or not the user agent override string should be used.
243 bool is_overriding_user_agent; 237 bool is_overriding_user_agent;
244 238
245 // Any redirect URLs that occurred before |url|. Useful for cross-process 239 // Any redirect URLs that occurred before |url|. Useful for cross-process
246 // navigations; defaults to empty. 240 // navigations; defaults to empty.
247 std::vector<GURL> redirects; 241 std::vector<GURL> redirects;
248 242
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // Timing of navigation events. 321 // Timing of navigation events.
328 NavigationTiming navigation_timing; 322 NavigationTiming navigation_timing;
329 323
330 // PlzNavigate 324 // PlzNavigate
331 // The ServiceWorkerProviderHost ID used for navigations, if it was already 325 // The ServiceWorkerProviderHost ID used for navigations, if it was already
332 // created by the browser. Set to kInvalidServiceWorkerProviderId otherwise. 326 // created by the browser. Set to kInvalidServiceWorkerProviderId otherwise.
333 // This parameter is not used in the current navigation architecture, where 327 // This parameter is not used in the current navigation architecture, where
334 // it will always be equal to kInvalidServiceWorkerProviderId. 328 // it will always be equal to kInvalidServiceWorkerProviderId.
335 int service_worker_provider_id; 329 int service_worker_provider_id;
336 330
331 // True if the navigation originated due to a user gesture.
332 bool has_user_gesture;
333
337 #if defined(OS_ANDROID) 334 #if defined(OS_ANDROID)
338 // The real content of the data: URL. Only used in Android WebView for 335 // The real content of the data: URL. Only used in Android WebView for
339 // implementing LoadDataWithBaseUrl API method to circumvent the restriction 336 // implementing LoadDataWithBaseUrl API method to circumvent the restriction
340 // on the GURL max length in the IPC layer. Short data: URLs can still be 337 // on the GURL max length in the IPC layer. Short data: URLs can still be
341 // passed in the |CommonNavigationParams::url| field. 338 // passed in the |CommonNavigationParams::url| field.
342 std::string data_url_as_string; 339 std::string data_url_as_string;
343 #endif 340 #endif
344 }; 341 };
345 342
346 // Helper struct keeping track in one place of all the parameters the browser 343 // Helper struct keeping track in one place of all the parameters the browser
347 // needs to provide to the renderer. 344 // needs to provide to the renderer.
348 struct NavigationParams { 345 struct NavigationParams {
349 NavigationParams(const CommonNavigationParams& common_params, 346 NavigationParams(const CommonNavigationParams& common_params,
350 const StartNavigationParams& start_params, 347 const StartNavigationParams& start_params,
351 const RequestNavigationParams& request_params); 348 const RequestNavigationParams& request_params);
352 ~NavigationParams(); 349 ~NavigationParams();
353 350
354 CommonNavigationParams common_params; 351 CommonNavigationParams common_params;
355 StartNavigationParams start_params; 352 StartNavigationParams start_params;
356 RequestNavigationParams request_params; 353 RequestNavigationParams request_params;
357 }; 354 };
358 355
359 } // namespace content 356 } // namespace content
360 357
361 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ 358 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698