1 // Copyright (c) 2012 The Chromium Embedded Framework Authors. 2 // Portions copyright (c) 2011 The Chromium Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 6 #ifndef CEF_LIBCEF_BROWSER_NAVIGATE_PARAMS_H_ 7 #define CEF_LIBCEF_BROWSER_NAVIGATE_PARAMS_H_ 8 #pragma once 9 10 #include <string> 11 12 #include "libcef/common/net/upload_data.h" 13 14 #include "content/public/browser/global_request_id.h" 15 #include "content/public/common/referrer.h" 16 #include "net/cookies/site_for_cookies.h" 17 #include "ui/base/page_transition_types.h" 18 #include "ui/base/window_open_disposition.h" 19 #include "url/gurl.h" 20 21 // Parameters that tell CefFrameHostImpl::Navigate() what to do. 22 struct CefNavigateParams { 23 CefNavigateParams(const GURL& a_url, ui::PageTransition a_transition); 24 ~CefNavigateParams(); 25 26 // The following parameters are sent to the renderer via CefMsg_LoadRequest. 27 // --------------------------------------------------------------------------- 28 29 // Request method. 30 std::string method; 31 32 // The URL/referrer to be loaded. 33 GURL url; 34 content::Referrer referrer; 35 36 // Usually the URL of the document in the top-level window, which may be 37 // checked by the third-party cookie blocking policy. Leaving it empty may 38 // lead to undesired cookie blocking. Third-party cookie blocking can be 39 // bypassed by setting site_for_cookies = url, but this should ideally 40 // only be done if there really is no way to determine the correct value. 41 net::SiteForCookies site_for_cookies; 42 43 // Additional HTTP request headers. 44 std::string headers; 45 46 // net::URLRequest load flags (0 by default). 47 int load_flags = 0; 48 49 // Upload data (may be NULL). 50 scoped_refptr<net::UploadData> upload_data; 51 52 // The following parameters are used to define browser behavior when servicing 53 // the navigation request. 54 // --------------------------------------------------------------------------- 55 56 // The disposition requested by the navigation source. Default is CURRENT_TAB. 57 WindowOpenDisposition disposition = WindowOpenDisposition::CURRENT_TAB; 58 59 // The transition type of the navigation. 60 ui::PageTransition transition; 61 62 // Whether this navigation was initiated by the renderer process. 63 bool is_renderer_initiated = false; 64 65 // If non-empty, the new tab contents encoding is overriden by this value. 66 std::string override_encoding; 67 68 // If false then the navigation was not initiated by a user gesture. Default 69 // is true. 70 bool user_gesture = true; 71 72 // Refers to a navigation that was parked in the browser in order to be 73 // transferred to another RVH. Only used in case of a redirection of a request 74 // to a different site that created a new RVH. 75 content::GlobalRequestID transferred_global_request_id; 76 77 private: 78 CefNavigateParams(); 79 }; 80 81 #endif // CEF_LIBCEF_BROWSER_NAVIGATE_PARAMS_H_ 82