OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_COMMON_AUTOMATION_MESSAGES_H__ | 5 #ifndef CHROME_COMMON_AUTOMATION_MESSAGES_H__ |
6 #define CHROME_COMMON_AUTOMATION_MESSAGES_H__ | 6 #define CHROME_COMMON_AUTOMATION_MESSAGES_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Whether to search forward or backward within the page. | 27 // Whether to search forward or backward within the page. |
28 bool forward; | 28 bool forward; |
29 | 29 |
30 // Whether search should be Case sensitive. | 30 // Whether search should be Case sensitive. |
31 bool match_case; | 31 bool match_case; |
32 | 32 |
33 // Whether this operation is first request (Find) or a follow-up (FindNext). | 33 // Whether this operation is first request (Find) or a follow-up (FindNext). |
34 bool find_next; | 34 bool find_next; |
35 }; | 35 }; |
36 | 36 |
| 37 struct AutomationURLResponse { |
| 38 AutomationURLResponse(); |
| 39 AutomationURLResponse(const std::string& mime_type, |
| 40 const std::string& headers, |
| 41 int64 content_length, |
| 42 const base::Time& last_modified, |
| 43 const std::string& redirect_url, |
| 44 int redirect_status); |
| 45 ~AutomationURLResponse(); |
| 46 |
| 47 std::string mime_type; |
| 48 std::string headers; |
| 49 int64 content_length; |
| 50 base::Time last_modified; |
| 51 std::string redirect_url; |
| 52 int redirect_status; |
| 53 }; |
| 54 |
| 55 struct ExternalTabSettings { |
| 56 ExternalTabSettings(); |
| 57 ExternalTabSettings(gfx::NativeWindow parent, |
| 58 const gfx::Rect& dimensions, |
| 59 unsigned int style, |
| 60 bool is_off_the_record, |
| 61 bool load_requests_via_automation, |
| 62 bool handle_top_level_requests, |
| 63 const GURL& initial_url, |
| 64 const GURL& referrer, |
| 65 bool infobars_enabled, |
| 66 bool route_all_top_level_navigations); |
| 67 ~ExternalTabSettings(); |
| 68 |
| 69 gfx::NativeWindow parent; |
| 70 gfx::Rect dimensions; |
| 71 unsigned int style; |
| 72 bool is_off_the_record; |
| 73 bool load_requests_via_automation; |
| 74 bool handle_top_level_requests; |
| 75 GURL initial_url; |
| 76 GURL referrer; |
| 77 bool infobars_enabled; |
| 78 bool route_all_top_level_navigations; |
| 79 }; |
| 80 |
| 81 struct NavigationInfo { |
| 82 NavigationInfo(); |
| 83 NavigationInfo(int navigation_type, |
| 84 int relative_offset, |
| 85 int navigation_index, |
| 86 const std::wstring& title, |
| 87 const GURL& url, |
| 88 const GURL& referrer, |
| 89 SecurityStyle security_style, |
| 90 bool displayed_insecure_content, |
| 91 bool ran_insecure_content); |
| 92 ~NavigationInfo(); |
| 93 |
| 94 int navigation_type; |
| 95 int relative_offset; |
| 96 int navigation_index; |
| 97 std::wstring title; |
| 98 GURL url; |
| 99 GURL referrer; |
| 100 SecurityStyle security_style; |
| 101 bool displayed_insecure_content; |
| 102 bool ran_insecure_content; |
| 103 }; |
| 104 |
| 105 // A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. |
| 106 struct MiniContextMenuParams { |
| 107 MiniContextMenuParams(); |
| 108 MiniContextMenuParams(int screen_x, |
| 109 int screen_y, |
| 110 const GURL& link_url, |
| 111 const GURL& unfiltered_link_url, |
| 112 const GURL& src_url, |
| 113 const GURL& page_url, |
| 114 const GURL& frame_url); |
| 115 ~MiniContextMenuParams(); |
| 116 |
| 117 // The x coordinate for displaying the menu. |
| 118 int screen_x; |
| 119 |
| 120 // The y coordinate for displaying the menu. |
| 121 int screen_y; |
| 122 |
| 123 // This is the URL of the link that encloses the node the context menu was |
| 124 // invoked on. |
| 125 GURL link_url; |
| 126 |
| 127 // The link URL to be used ONLY for "copy link address". We don't validate |
| 128 // this field in the frontend process. |
| 129 GURL unfiltered_link_url; |
| 130 |
| 131 // This is the source URL for the element that the context menu was |
| 132 // invoked on. Example of elements with source URLs are img, audio, and |
| 133 // video. |
| 134 GURL src_url; |
| 135 |
| 136 // This is the URL of the top level page that the context menu was invoked |
| 137 // on. |
| 138 GURL page_url; |
| 139 |
| 140 // This is the URL of the subframe that the context menu was invoked on. |
| 141 GURL frame_url; |
| 142 }; |
| 143 |
| 144 struct AttachExternalTabParams { |
| 145 AttachExternalTabParams(); |
| 146 AttachExternalTabParams(uint64 cookie, |
| 147 const GURL& url, |
| 148 const gfx::Rect& dimensions, |
| 149 int disposition, |
| 150 bool user_gesture, |
| 151 const std::string& profile_name); |
| 152 ~AttachExternalTabParams(); |
| 153 |
| 154 uint64 cookie; |
| 155 GURL url; |
| 156 gfx::Rect dimensions; |
| 157 int disposition; |
| 158 bool user_gesture; |
| 159 std::string profile_name; |
| 160 }; |
| 161 |
| 162 #if defined(OS_WIN) |
| 163 |
| 164 struct Reposition_Params { |
| 165 HWND window; |
| 166 HWND window_insert_after; |
| 167 int left; |
| 168 int top; |
| 169 int width; |
| 170 int height; |
| 171 int flags; |
| 172 bool set_parent; |
| 173 HWND parent_window; |
| 174 }; |
| 175 |
| 176 #endif // defined(OS_WIN) |
| 177 |
| 178 struct AutomationURLRequest { |
| 179 AutomationURLRequest(); |
| 180 AutomationURLRequest(const std::string& url, |
| 181 const std::string& method, |
| 182 const std::string& referrer, |
| 183 const std::string& extra_request_headers, |
| 184 scoped_refptr<net::UploadData> upload_data, |
| 185 int resource_type, |
| 186 int load_flags); |
| 187 ~AutomationURLRequest(); |
| 188 |
| 189 std::string url; |
| 190 std::string method; |
| 191 std::string referrer; |
| 192 std::string extra_request_headers; |
| 193 scoped_refptr<net::UploadData> upload_data; |
| 194 int resource_type; // see webkit/glue/resource_type.h |
| 195 int load_flags; // see net/base/load_flags.h |
| 196 }; |
| 197 |
37 namespace IPC { | 198 namespace IPC { |
38 | 199 |
39 template <> | 200 template <> |
40 struct ParamTraits<AutomationMsg_Find_Params> { | 201 struct ParamTraits<AutomationMsg_Find_Params> { |
41 typedef AutomationMsg_Find_Params param_type; | 202 typedef AutomationMsg_Find_Params param_type; |
42 static void Write(Message* m, const param_type& p); | 203 static void Write(Message* m, const param_type& p); |
43 static bool Read(const Message* m, void** iter, param_type* p); | 204 static bool Read(const Message* m, void** iter, param_type* p); |
44 static void Log(const param_type& p, std::string* l); | 205 static void Log(const param_type& p, std::string* l); |
45 }; | 206 }; |
46 | 207 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 239 |
79 template <> | 240 template <> |
80 struct ParamTraits<PageType> { | 241 struct ParamTraits<PageType> { |
81 typedef PageType param_type; | 242 typedef PageType param_type; |
82 static void Write(Message* m, const param_type& p); | 243 static void Write(Message* m, const param_type& p); |
83 static bool Read(const Message* m, void** iter, param_type* p); | 244 static bool Read(const Message* m, void** iter, param_type* p); |
84 static void Log(const param_type& p, std::string* l); | 245 static void Log(const param_type& p, std::string* l); |
85 }; | 246 }; |
86 | 247 |
87 #if defined(OS_WIN) | 248 #if defined(OS_WIN) |
88 struct Reposition_Params { | |
89 HWND window; | |
90 HWND window_insert_after; | |
91 int left; | |
92 int top; | |
93 int width; | |
94 int height; | |
95 int flags; | |
96 bool set_parent; | |
97 HWND parent_window; | |
98 }; | |
99 | 249 |
100 // Traits for SetWindowPos_Params structure to pack/unpack. | 250 // Traits for SetWindowPos_Params structure to pack/unpack. |
101 template <> | 251 template <> |
102 struct ParamTraits<Reposition_Params> { | 252 struct ParamTraits<Reposition_Params> { |
103 typedef Reposition_Params param_type; | 253 typedef Reposition_Params param_type; |
104 static void Write(Message* m, const param_type& p) { | 254 static void Write(Message* m, const param_type& p) { |
105 WriteParam(m, p.window); | 255 WriteParam(m, p.window); |
106 WriteParam(m, p.window_insert_after); | 256 WriteParam(m, p.window_insert_after); |
107 WriteParam(m, p.left); | 257 WriteParam(m, p.left); |
108 WriteParam(m, p.top); | 258 WriteParam(m, p.top); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 LogParam(p.flags, l); | 290 LogParam(p.flags, l); |
141 l->append(", "); | 291 l->append(", "); |
142 LogParam(p.set_parent, l); | 292 LogParam(p.set_parent, l); |
143 l->append(", "); | 293 l->append(", "); |
144 LogParam(p.parent_window, l); | 294 LogParam(p.parent_window, l); |
145 l->append(")"); | 295 l->append(")"); |
146 } | 296 } |
147 }; | 297 }; |
148 #endif // defined(OS_WIN) | 298 #endif // defined(OS_WIN) |
149 | 299 |
150 struct AutomationURLRequest { | |
151 AutomationURLRequest(); | |
152 AutomationURLRequest(const std::string& url, | |
153 const std::string& method, | |
154 const std::string& referrer, | |
155 const std::string& extra_request_headers, | |
156 scoped_refptr<net::UploadData> upload_data, | |
157 int resource_type, | |
158 int load_flags); | |
159 ~AutomationURLRequest(); | |
160 | |
161 std::string url; | |
162 std::string method; | |
163 std::string referrer; | |
164 std::string extra_request_headers; | |
165 scoped_refptr<net::UploadData> upload_data; | |
166 int resource_type; // see webkit/glue/resource_type.h | |
167 int load_flags; // see net/base/load_flags.h | |
168 }; | |
169 | |
170 // Traits for AutomationURLRequest structure to pack/unpack. | 300 // Traits for AutomationURLRequest structure to pack/unpack. |
171 template <> | 301 template <> |
172 struct ParamTraits<AutomationURLRequest> { | 302 struct ParamTraits<AutomationURLRequest> { |
173 typedef AutomationURLRequest param_type; | 303 typedef AutomationURLRequest param_type; |
174 static void Write(Message* m, const param_type& p); | 304 static void Write(Message* m, const param_type& p); |
175 static bool Read(const Message* m, void** iter, param_type* p); | 305 static bool Read(const Message* m, void** iter, param_type* p); |
176 static void Log(const param_type& p, std::string* l); | 306 static void Log(const param_type& p, std::string* l); |
177 }; | 307 }; |
178 | 308 |
179 struct AutomationURLResponse { | |
180 AutomationURLResponse(); | |
181 AutomationURLResponse(const std::string& mime_type, | |
182 const std::string& headers, | |
183 int64 content_length, | |
184 const base::Time& last_modified, | |
185 const std::string& redirect_url, | |
186 int redirect_status); | |
187 ~AutomationURLResponse(); | |
188 | |
189 std::string mime_type; | |
190 std::string headers; | |
191 int64 content_length; | |
192 base::Time last_modified; | |
193 std::string redirect_url; | |
194 int redirect_status; | |
195 }; | |
196 | |
197 // Traits for AutomationURLResponse structure to pack/unpack. | 309 // Traits for AutomationURLResponse structure to pack/unpack. |
198 template <> | 310 template <> |
199 struct ParamTraits<AutomationURLResponse> { | 311 struct ParamTraits<AutomationURLResponse> { |
200 typedef AutomationURLResponse param_type; | 312 typedef AutomationURLResponse param_type; |
201 static void Write(Message* m, const param_type& p); | 313 static void Write(Message* m, const param_type& p); |
202 static bool Read(const Message* m, void** iter, param_type* p); | 314 static bool Read(const Message* m, void** iter, param_type* p); |
203 static void Log(const param_type& p, std::string* l); | 315 static void Log(const param_type& p, std::string* l); |
204 }; | 316 }; |
205 | 317 |
206 struct ExternalTabSettings { | |
207 ExternalTabSettings(); | |
208 ExternalTabSettings(gfx::NativeWindow parent, | |
209 const gfx::Rect& dimensions, | |
210 unsigned int style, | |
211 bool is_off_the_record, | |
212 bool load_requests_via_automation, | |
213 bool handle_top_level_requests, | |
214 const GURL& initial_url, | |
215 const GURL& referrer, | |
216 bool infobars_enabled, | |
217 bool route_all_top_level_navigations); | |
218 ~ExternalTabSettings(); | |
219 | |
220 gfx::NativeWindow parent; | |
221 gfx::Rect dimensions; | |
222 unsigned int style; | |
223 bool is_off_the_record; | |
224 bool load_requests_via_automation; | |
225 bool handle_top_level_requests; | |
226 GURL initial_url; | |
227 GURL referrer; | |
228 bool infobars_enabled; | |
229 bool route_all_top_level_navigations; | |
230 }; | |
231 | |
232 // Traits for ExternalTabSettings structure to pack/unpack. | 318 // Traits for ExternalTabSettings structure to pack/unpack. |
233 template <> | 319 template <> |
234 struct ParamTraits<ExternalTabSettings> { | 320 struct ParamTraits<ExternalTabSettings> { |
235 typedef ExternalTabSettings param_type; | 321 typedef ExternalTabSettings param_type; |
236 static void Write(Message* m, const param_type& p); | 322 static void Write(Message* m, const param_type& p); |
237 static bool Read(const Message* m, void** iter, param_type* p); | 323 static bool Read(const Message* m, void** iter, param_type* p); |
238 static void Log(const param_type& p, std::string* l); | 324 static void Log(const param_type& p, std::string* l); |
239 }; | 325 }; |
240 | 326 |
241 struct NavigationInfo { | |
242 NavigationInfo(); | |
243 NavigationInfo(int navigation_type, | |
244 int relative_offset, | |
245 int navigation_index, | |
246 const std::wstring& title, | |
247 const GURL& url, | |
248 const GURL& referrer, | |
249 SecurityStyle security_style, | |
250 bool displayed_insecure_content, | |
251 bool ran_insecure_content); | |
252 ~NavigationInfo(); | |
253 | |
254 int navigation_type; | |
255 int relative_offset; | |
256 int navigation_index; | |
257 std::wstring title; | |
258 GURL url; | |
259 GURL referrer; | |
260 SecurityStyle security_style; | |
261 bool displayed_insecure_content; | |
262 bool ran_insecure_content; | |
263 }; | |
264 | |
265 // Traits for NavigationInfo structure to pack/unpack. | 327 // Traits for NavigationInfo structure to pack/unpack. |
266 template <> | 328 template <> |
267 struct ParamTraits<NavigationInfo> { | 329 struct ParamTraits<NavigationInfo> { |
268 typedef NavigationInfo param_type; | 330 typedef NavigationInfo param_type; |
269 static void Write(Message* m, const param_type& p); | 331 static void Write(Message* m, const param_type& p); |
270 static bool Read(const Message* m, void** iter, param_type* p); | 332 static bool Read(const Message* m, void** iter, param_type* p); |
271 static void Log(const param_type& p, std::string* l); | 333 static void Log(const param_type& p, std::string* l); |
272 }; | 334 }; |
273 | 335 |
274 // A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. | |
275 struct MiniContextMenuParams { | |
276 MiniContextMenuParams(); | |
277 MiniContextMenuParams(int screen_x, | |
278 int screen_y, | |
279 const GURL& link_url, | |
280 const GURL& unfiltered_link_url, | |
281 const GURL& src_url, | |
282 const GURL& page_url, | |
283 const GURL& frame_url); | |
284 ~MiniContextMenuParams(); | |
285 | |
286 // The x coordinate for displaying the menu. | |
287 int screen_x; | |
288 | |
289 // The y coordinate for displaying the menu. | |
290 int screen_y; | |
291 | |
292 // This is the URL of the link that encloses the node the context menu was | |
293 // invoked on. | |
294 GURL link_url; | |
295 | |
296 // The link URL to be used ONLY for "copy link address". We don't validate | |
297 // this field in the frontend process. | |
298 GURL unfiltered_link_url; | |
299 | |
300 // This is the source URL for the element that the context menu was | |
301 // invoked on. Example of elements with source URLs are img, audio, and | |
302 // video. | |
303 GURL src_url; | |
304 | |
305 // This is the URL of the top level page that the context menu was invoked | |
306 // on. | |
307 GURL page_url; | |
308 | |
309 // This is the URL of the subframe that the context menu was invoked on. | |
310 GURL frame_url; | |
311 }; | |
312 | |
313 // Traits for MiniContextMenuParams structure to pack/unpack. | 336 // Traits for MiniContextMenuParams structure to pack/unpack. |
314 template <> | 337 template <> |
315 struct ParamTraits<MiniContextMenuParams> { | 338 struct ParamTraits<MiniContextMenuParams> { |
316 typedef MiniContextMenuParams param_type; | 339 typedef MiniContextMenuParams param_type; |
317 static void Write(Message* m, const param_type& p); | 340 static void Write(Message* m, const param_type& p); |
318 static bool Read(const Message* m, void** iter, param_type* p); | 341 static bool Read(const Message* m, void** iter, param_type* p); |
319 static void Log(const param_type& p, std::string* l); | 342 static void Log(const param_type& p, std::string* l); |
320 }; | 343 }; |
321 | 344 |
322 struct AttachExternalTabParams { | |
323 AttachExternalTabParams(); | |
324 AttachExternalTabParams(uint64 cookie, | |
325 const GURL& url, | |
326 const gfx::Rect& dimensions, | |
327 int disposition, | |
328 bool user_gesture, | |
329 const std::string& profile_name); | |
330 ~AttachExternalTabParams(); | |
331 | |
332 uint64 cookie; | |
333 GURL url; | |
334 gfx::Rect dimensions; | |
335 int disposition; | |
336 bool user_gesture; | |
337 std::string profile_name; | |
338 }; | |
339 | |
340 template <> | 345 template <> |
341 struct ParamTraits<AttachExternalTabParams> { | 346 struct ParamTraits<AttachExternalTabParams> { |
342 typedef AttachExternalTabParams param_type; | 347 typedef AttachExternalTabParams param_type; |
343 static void Write(Message* m, const param_type& p); | 348 static void Write(Message* m, const param_type& p); |
344 static bool Read(const Message* m, void** iter, param_type* p); | 349 static bool Read(const Message* m, void** iter, param_type* p); |
345 static void Log(const param_type& p, std::string* l); | 350 static void Log(const param_type& p, std::string* l); |
346 }; | 351 }; |
347 | 352 |
348 } // namespace IPC | 353 } // namespace IPC |
349 | 354 |
350 #include "chrome/common/automation_messages_internal.h" | 355 #include "chrome/common/automation_messages_internal.h" |
351 | 356 |
352 #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ | 357 #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ |
OLD | NEW |