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 "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/global_request_id.h" | 15 #include "content/public/browser/global_request_id.h" |
16 #include "content/public/common/page_transition_types.h" | 16 #include "content/public/common/page_transition_types.h" |
17 #include "content/public/common/referrer.h" | 17 #include "content/public/common/referrer.h" |
18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 19 #include "webkit/glue/resource_request_body.h" |
19 #include "webkit/glue/window_open_disposition.h" | 20 #include "webkit/glue/window_open_disposition.h" |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 | 23 |
23 class WebContents; | 24 class WebContents; |
24 | 25 |
25 struct CONTENT_EXPORT OpenURLParams { | 26 struct CONTENT_EXPORT OpenURLParams { |
26 OpenURLParams(const GURL& url, | 27 OpenURLParams(const GURL& url, |
27 const Referrer& referrer, | 28 const Referrer& referrer, |
28 WindowOpenDisposition disposition, | 29 WindowOpenDisposition disposition, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 std::string override_encoding; | 62 std::string override_encoding; |
62 | 63 |
63 // Reference to the old request id in case this is a navigation that is being | 64 // Reference to the old request id in case this is a navigation that is being |
64 // transferred to a new renderer. | 65 // transferred to a new renderer. |
65 GlobalRequestID transferred_global_request_id; | 66 GlobalRequestID transferred_global_request_id; |
66 | 67 |
67 // Indicates whether this navigation involves a cross-process redirect, | 68 // Indicates whether this navigation involves a cross-process redirect, |
68 // in which case it should replace the current navigation entry. | 69 // in which case it should replace the current navigation entry. |
69 bool is_cross_site_redirect; | 70 bool is_cross_site_redirect; |
70 | 71 |
| 72 // The Post data in HTTPRequest body. |
| 73 scoped_refptr<webkit_glue::ResourceRequestBody> browser_initiated_post_data; |
| 74 |
71 private: | 75 private: |
72 OpenURLParams(); | 76 OpenURLParams(); |
73 }; | 77 }; |
74 | 78 |
75 class PageNavigator { | 79 class PageNavigator { |
76 public: | 80 public: |
77 virtual ~PageNavigator() {} | 81 virtual ~PageNavigator() {} |
78 | 82 |
79 // Opens a URL with the given disposition. The transition specifies how this | 83 // Opens a URL with the given disposition. The transition specifies how this |
80 // navigation should be recorded in the history system (for example, typed). | 84 // navigation should be recorded in the history system (for example, typed). |
81 // Returns the WebContents the URL is opened in, or NULL if the URL wasn't | 85 // Returns the WebContents the URL is opened in, or NULL if the URL wasn't |
82 // opened immediately. | 86 // opened immediately. |
83 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; | 87 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; |
84 }; | 88 }; |
85 | 89 |
86 } | 90 } |
87 | 91 |
88 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 92 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
OLD | NEW |