| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_ | 5 #ifndef IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_ |
| 6 #define IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_ | 6 #define IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import "ios/web/public/navigation_manager.h" |
| 9 | |
| 10 #import "base/mac/scoped_nsobject.h" | |
| 11 #include "ios/web/public/referrer.h" | |
| 12 #include "ui/base/page_transition_types.h" | |
| 13 #include "url/gurl.h" | |
| 14 | 9 |
| 15 namespace web { | 10 namespace web { |
| 16 | 11 |
| 17 // Parameters for URL loading. Most parameters are optional, and can be left at | 12 // TODO(crbug.com/597990) Remove this alias once all clients are switched to |
| 18 // the default values set by the constructor. | 13 // use web::NavigationManager::WebLoadParams. |
| 19 // TODO(crbug.com/597990): Move this into NavigationManager to parallel | 14 using WebLoadParams = web::NavigationManager::WebLoadParams; |
| 20 // NavigationController's LoadURLParams (which this is modeled after). | |
| 21 struct WebLoadParams { | |
| 22 public: | |
| 23 // The URL to load. Must be set. | |
| 24 GURL url; | |
| 25 | |
| 26 // The referrer for the load. May be empty. | |
| 27 Referrer referrer; | |
| 28 | |
| 29 // The transition type for the load. Defaults to PAGE_TRANSITION_LINK. | |
| 30 ui::PageTransition transition_type; | |
| 31 | |
| 32 // True for renderer-initiated navigations. This is | |
| 33 // important for tracking whether to display pending URLs. | |
| 34 bool is_renderer_initiated; | |
| 35 | |
| 36 // Any extra HTTP headers to add to the load. | |
| 37 base::scoped_nsobject<NSDictionary> extra_headers; | |
| 38 | |
| 39 // Any post data to send with the load. When setting this, you should | |
| 40 // generally set a Content-Type header as well. | |
| 41 base::scoped_nsobject<NSData> post_data; | |
| 42 | |
| 43 // Create a new WebLoadParams with the given URL and defaults for all other | |
| 44 // parameters. | |
| 45 explicit WebLoadParams(const GURL& url); | |
| 46 ~WebLoadParams(); | |
| 47 | |
| 48 // Allow copying WebLoadParams. | |
| 49 WebLoadParams(const WebLoadParams& other); | |
| 50 WebLoadParams& operator=(const WebLoadParams& other); | |
| 51 }; | |
| 52 | 15 |
| 53 } // namespace web | 16 } // namespace web |
| 54 | 17 |
| 55 #endif // IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_ | 18 #endif // IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_ |
| OLD | NEW |