OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // PageNavigator defines an interface that can be used to express the user's | 5 // PageNavigator defines an interface that can be used to express the user's |
6 // intention to navigate to a particular URL. The implementing class should | 6 // intention to navigate to a particular URL. The implementing class should |
7 // perform the navigation. | 7 // perform the navigation. |
8 | 8 |
9 #ifndef CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 9 #ifndef CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
10 #define CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 10 #define CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/ref_counted_memory.h" | |
16 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
17 #include "content/public/browser/global_request_id.h" | 16 #include "content/public/browser/global_request_id.h" |
18 #include "content/public/browser/site_instance.h" | 17 #include "content/public/browser/site_instance.h" |
19 #include "content/public/common/referrer.h" | 18 #include "content/public/common/referrer.h" |
| 19 #include "content/public/common/resource_request_body.h" |
20 #include "ui/base/page_transition_types.h" | 20 #include "ui/base/page_transition_types.h" |
21 #include "ui/base/window_open_disposition.h" | 21 #include "ui/base/window_open_disposition.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 class WebContents; | 26 class WebContents; |
27 | 27 |
28 struct CONTENT_EXPORT OpenURLParams { | 28 struct CONTENT_EXPORT OpenURLParams { |
29 OpenURLParams(const GURL& url, | 29 OpenURLParams(const GURL& url, |
(...skipping 15 matching lines...) Expand all Loading... |
45 Referrer referrer; | 45 Referrer referrer; |
46 | 46 |
47 // SiteInstance of the frame that initiated the navigation or null if we | 47 // SiteInstance of the frame that initiated the navigation or null if we |
48 // don't know it. | 48 // don't know it. |
49 scoped_refptr<content::SiteInstance> source_site_instance; | 49 scoped_refptr<content::SiteInstance> source_site_instance; |
50 | 50 |
51 // Any redirect URLs that occurred for this navigation before |url|. | 51 // Any redirect URLs that occurred for this navigation before |url|. |
52 std::vector<GURL> redirect_chain; | 52 std::vector<GURL> redirect_chain; |
53 | 53 |
54 // Indicates whether this navigation will be sent using POST. | 54 // Indicates whether this navigation will be sent using POST. |
55 // The POST method is limited support for basic POST data by leveraging | |
56 // NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST. | |
57 // It is not for things like file uploads. | |
58 bool uses_post; | 55 bool uses_post; |
59 | 56 |
60 // The post data when the navigation uses POST. | 57 // The post data when the navigation uses POST. |
61 scoped_refptr<base::RefCountedMemory> browser_initiated_post_data; | 58 scoped_refptr<ResourceRequestBody> post_data; |
62 | 59 |
63 // Extra headers to add to the request for this page. Headers are | 60 // Extra headers to add to the request for this page. Headers are |
64 // represented as "<name>: <value>" and separated by \r\n. The entire string | 61 // represented as "<name>: <value>" and separated by \r\n. The entire string |
65 // is terminated by \r\n. May be empty if no extra headers are needed. | 62 // is terminated by \r\n. May be empty if no extra headers are needed. |
66 std::string extra_headers; | 63 std::string extra_headers; |
67 | 64 |
68 // The browser-global FrameTreeNode ID or -1 to indicate the main frame. | 65 // The browser-global FrameTreeNode ID or -1 to indicate the main frame. |
69 int frame_tree_node_id; | 66 int frame_tree_node_id; |
70 | 67 |
71 // The disposition requested by the navigation source. | 68 // The disposition requested by the navigation source. |
(...skipping 24 matching lines...) Expand all Loading... |
96 // Opens a URL with the given disposition. The transition specifies how this | 93 // Opens a URL with the given disposition. The transition specifies how this |
97 // navigation should be recorded in the history system (for example, typed). | 94 // navigation should be recorded in the history system (for example, typed). |
98 // Returns the WebContents the URL is opened in, or nullptr if the URL wasn't | 95 // Returns the WebContents the URL is opened in, or nullptr if the URL wasn't |
99 // opened immediately. | 96 // opened immediately. |
100 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; | 97 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; |
101 }; | 98 }; |
102 | 99 |
103 } // namespace content | 100 } // namespace content |
104 | 101 |
105 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 102 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
OLD | NEW |