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 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Load type used in LoadURLParams. | 58 // Load type used in LoadURLParams. |
59 // | 59 // |
60 // A Java counterpart will be generated for this enum. | 60 // A Java counterpart will be generated for this enum. |
61 // GENERATED_JAVA_ENUM_PACKAGE: ( | 61 // GENERATED_JAVA_ENUM_PACKAGE: ( |
62 // org.chromium.content_public.browser.navigation_controller) | 62 // org.chromium.content_public.browser.navigation_controller) |
63 // GENERATED_JAVA_PREFIX_TO_STRIP: LOAD_TYPE_ | 63 // GENERATED_JAVA_PREFIX_TO_STRIP: LOAD_TYPE_ |
64 enum LoadURLType { | 64 enum LoadURLType { |
65 // For loads that do not fall into any types below. | 65 // For loads that do not fall into any types below. |
66 LOAD_TYPE_DEFAULT, | 66 LOAD_TYPE_DEFAULT, |
67 | 67 |
68 // An http post load request initiated from browser side. | |
69 // The post data is passed in |browser_initiated_post_data|. | |
70 LOAD_TYPE_BROWSER_INITIATED_HTTP_POST, | |
71 | |
72 // Loads a 'data:' scheme URL with specified base URL and a history entry | 68 // Loads a 'data:' scheme URL with specified base URL and a history entry |
73 // URL. This is only safe to be used for browser-initiated data: URL | 69 // URL. This is only safe to be used for browser-initiated data: URL |
74 // navigations, since it shows arbitrary content as if it comes from | 70 // navigations, since it shows arbitrary content as if it comes from |
75 // |virtual_url_for_data_url|. | 71 // |virtual_url_for_data_url|. |
76 LOAD_TYPE_DATA | 72 LOAD_TYPE_DATA |
77 | 73 |
78 // Adding new LoadURLType? Also update LoadUrlParams.java static constants. | 74 // Adding new LoadURLType? Also update LoadUrlParams.java static constants. |
79 }; | 75 }; |
80 | 76 |
81 // User agent override type used in LoadURLParams. | 77 // User agent override type used in LoadURLParams. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 ui::PageTransition transition, | 114 ui::PageTransition transition, |
119 bool is_renderer_initiated, | 115 bool is_renderer_initiated, |
120 const std::string& extra_headers, | 116 const std::string& extra_headers, |
121 BrowserContext* browser_context); | 117 BrowserContext* browser_context); |
122 | 118 |
123 // Extra optional parameters for LoadURLWithParams. | 119 // Extra optional parameters for LoadURLWithParams. |
124 struct CONTENT_EXPORT LoadURLParams { | 120 struct CONTENT_EXPORT LoadURLParams { |
125 // The url to load. This field is required. | 121 // The url to load. This field is required. |
126 GURL url; | 122 GURL url; |
127 | 123 |
| 124 // HTTP method to use. |
| 125 std::string method = "GET"; |
| 126 |
128 // SiteInstance of the frame that initiated the navigation or null if we | 127 // SiteInstance of the frame that initiated the navigation or null if we |
129 // don't know it. | 128 // don't know it. |
130 scoped_refptr<SiteInstance> source_site_instance; | 129 scoped_refptr<SiteInstance> source_site_instance; |
131 | 130 |
132 // See LoadURLType comments above. | 131 // See LoadURLType comments above. |
133 LoadURLType load_type; | 132 LoadURLType load_type; |
134 | 133 |
135 // PageTransition for this load. See PageTransition for details. | 134 // PageTransition for this load. See PageTransition for details. |
136 // Note the default value in constructor below. | 135 // Note the default value in constructor below. |
137 ui::PageTransition transition_type; | 136 ui::PageTransition transition_type; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 GURL virtual_url_for_data_url; | 170 GURL virtual_url_for_data_url; |
172 | 171 |
173 #if defined(OS_ANDROID) | 172 #if defined(OS_ANDROID) |
174 // Used in LOAD_TYPE_DATA loads only. The real data URI is represented | 173 // Used in LOAD_TYPE_DATA loads only. The real data URI is represented |
175 // as a string to circumvent the restriction on GURL size. This is only | 174 // as a string to circumvent the restriction on GURL size. This is only |
176 // needed to pass URLs that exceed the IPC limit (kMaxURLChars). Short | 175 // needed to pass URLs that exceed the IPC limit (kMaxURLChars). Short |
177 // data: URLs can be passed in the |url| field. | 176 // data: URLs can be passed in the |url| field. |
178 scoped_refptr<base::RefCountedString> data_url_as_string; | 177 scoped_refptr<base::RefCountedString> data_url_as_string; |
179 #endif | 178 #endif |
180 | 179 |
181 // Used in LOAD_TYPE_BROWSER_INITIATED_HTTP_POST loads only. Carries the | 180 // Used only if method == "POST". Carries the post data of the load. |
182 // post data of the load. Ownership is transferred to NavigationController | 181 // Ownership is transferred to NavigationController after LoadURLWithParams |
183 // after LoadURLWithParams call. | 182 // call. |
184 scoped_refptr<base::RefCountedMemory> browser_initiated_post_data; | 183 scoped_refptr<base::RefCountedMemory> browser_initiated_post_data; |
185 | 184 |
186 // True if this URL should be able to access local resources. | 185 // True if this URL should be able to access local resources. |
187 bool can_load_local_resources; | 186 bool can_load_local_resources; |
188 | 187 |
189 // Indicates whether this navigation should replace the current | 188 // Indicates whether this navigation should replace the current |
190 // navigation entry. | 189 // navigation entry. |
191 bool should_replace_current_entry; | 190 bool should_replace_current_entry; |
192 | 191 |
193 // Used to specify which frame to navigate. If empty, the main frame is | 192 // Used to specify which frame to navigate. If empty, the main frame is |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 495 |
497 private: | 496 private: |
498 // This interface should only be implemented inside content. | 497 // This interface should only be implemented inside content. |
499 friend class NavigationControllerImpl; | 498 friend class NavigationControllerImpl; |
500 NavigationController() {} | 499 NavigationController() {} |
501 }; | 500 }; |
502 | 501 |
503 } // namespace content | 502 } // namespace content |
504 | 503 |
505 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 504 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
OLD | NEW |