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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_
6 #define IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_
8 #import <Foundation/Foundation.h>
10 #import "base/mac/scoped_nsobject.h"
11 #include "ios/net/request_tracker.h"
12 #include "ios/web/public/referrer.h"
13 #include "ui/base/page_transition_types.h"
18 // Parameters for creating a tab. Most paramaters are optional, and
19 // can be left at the default values set by the constructor.
20 // TODO(stuartmorgan): Remove the dependency on RequestTracker, then move
21 // this into NavigationManager to parallel NavigationController's
22 // LoadURLParams (which this is modeled after).
23 struct WebLoadParams
{
25 // The URL to load. Must be set.
28 // The referrer for the load. May be empty.
31 // The transition type for the load. Defaults to PAGE_TRANSITION_LINK.
32 ui::PageTransition transition_type
;
34 // True for renderer-initiated navigations. This is
35 // important for tracking whether to display pending URLs.
36 bool is_renderer_initiated
;
38 // The cache mode to load with. Defaults to CACHE_NORMAL.
39 net::RequestTracker::CacheMode cache_mode
;
41 // Any extra HTTP headers to add to the load.
42 base::scoped_nsobject
<NSDictionary
> extra_headers
;
44 // Any post data to send with the load. When setting this, you should
45 // generally set a Content-Type header as well.
46 base::scoped_nsobject
<NSData
> post_data
;
48 // Create a new WebLoadParams with the given URL and defaults for all other
50 explicit WebLoadParams(const GURL
& url
);
53 // Allow copying WebLoadParams.
54 WebLoadParams(const WebLoadParams
& other
);
55 WebLoadParams
& operator=(const WebLoadParams
& other
);
60 #endif // IOS_WEB_NAVIGATION_WEB_LOAD_PARAMS_H_