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 28 matching lines...) Expand all Loading... |
57 // Whether this navigation is initiated by the renderer process. | 58 // Whether this navigation is initiated by the renderer process. |
58 bool is_renderer_initiated; | 59 bool is_renderer_initiated; |
59 | 60 |
60 // The override encoding of the URL contents to be opened. | 61 // The override encoding of the URL contents to be opened. |
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 |
| 68 // The Post data in HTTPRequest body. |
| 69 scoped_refptr<webkit_glue::ResourceRequestBody> browser_initiated_post_data; |
| 70 |
67 private: | 71 private: |
68 OpenURLParams(); | 72 OpenURLParams(); |
69 }; | 73 }; |
70 | 74 |
71 class PageNavigator { | 75 class PageNavigator { |
72 public: | 76 public: |
73 virtual ~PageNavigator() {} | 77 virtual ~PageNavigator() {} |
74 | 78 |
75 // Opens a URL with the given disposition. The transition specifies how this | 79 // Opens a URL with the given disposition. The transition specifies how this |
76 // navigation should be recorded in the history system (for example, typed). | 80 // navigation should be recorded in the history system (for example, typed). |
77 // Returns the WebContents the URL is opened in, or NULL if the URL wasn't | 81 // Returns the WebContents the URL is opened in, or NULL if the URL wasn't |
78 // opened immediately. | 82 // opened immediately. |
79 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; | 83 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; |
80 }; | 84 }; |
81 | 85 |
82 } | 86 } |
83 | 87 |
84 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 88 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
OLD | NEW |