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_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__ | 5 #ifndef CHROME_COMMON_AUTOMATION_MESSAGES_H__ |
6 #define CHROME_TEST_AUTOMATION_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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "chrome/browser/tab_contents/navigation_entry.h" | 12 #include "chrome/common/automation_constants.h" |
13 #include "chrome/browser/tab_contents/security_style.h" | |
14 #include "chrome/common/common_param_traits.h" | 13 #include "chrome/common/common_param_traits.h" |
15 #include "chrome/test/automation/automation_constants.h" | 14 #include "chrome/common/page_type.h" |
| 15 #include "chrome/common/security_style.h" |
16 #include "gfx/rect.h" | 16 #include "gfx/rect.h" |
17 #include "net/base/upload_data.h" | 17 #include "net/base/upload_data.h" |
18 | 18 |
19 | |
20 struct AutomationMsg_Find_Params { | 19 struct AutomationMsg_Find_Params { |
21 // Unused value, which exists only for backwards compat. | 20 // Unused value, which exists only for backwards compat. |
22 int unused; | 21 int unused; |
23 | 22 |
24 // The word(s) to find on the page. | 23 // The word(s) to find on the page. |
25 string16 search_string; | 24 string16 search_string; |
26 | 25 |
27 // Whether to search forward or backward within the page. | 26 // Whether to search forward or backward within the page. |
28 bool forward; | 27 bool forward; |
29 | 28 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 default: | 191 default: |
193 control = "UNKNOWN"; | 192 control = "UNKNOWN"; |
194 break; | 193 break; |
195 } | 194 } |
196 | 195 |
197 LogParam(control, l); | 196 LogParam(control, l); |
198 } | 197 } |
199 }; | 198 }; |
200 | 199 |
201 template <> | 200 template <> |
202 struct ParamTraits<NavigationEntry::PageType> { | 201 struct ParamTraits<PageType> { |
203 typedef NavigationEntry::PageType param_type; | 202 typedef PageType param_type; |
204 static void Write(Message* m, const param_type& p) { | 203 static void Write(Message* m, const param_type& p) { |
205 m->WriteInt(p); | 204 m->WriteInt(p); |
206 } | 205 } |
207 static bool Read(const Message* m, void** iter, param_type* p) { | 206 static bool Read(const Message* m, void** iter, param_type* p) { |
208 int type; | 207 int type; |
209 if (!m->ReadInt(iter, &type)) | 208 if (!m->ReadInt(iter, &type)) |
210 return false; | 209 return false; |
211 *p = static_cast<NavigationEntry::PageType>(type); | 210 *p = static_cast<PageType>(type); |
212 return true; | 211 return true; |
213 } | 212 } |
214 static void Log(const param_type& p, std::string* l) { | 213 static void Log(const param_type& p, std::string* l) { |
215 std::string control; | 214 std::string control; |
216 switch (p) { | 215 switch (p) { |
217 case NavigationEntry::NORMAL_PAGE: | 216 case NORMAL_PAGE: |
218 control = "NORMAL_PAGE"; | 217 control = "NORMAL_PAGE"; |
219 break; | 218 break; |
220 case NavigationEntry::ERROR_PAGE: | 219 case ERROR_PAGE: |
221 control = "ERROR_PAGE"; | 220 control = "ERROR_PAGE"; |
222 break; | 221 break; |
223 case NavigationEntry::INTERSTITIAL_PAGE: | 222 case INTERSTITIAL_PAGE: |
224 control = "INTERSTITIAL_PAGE"; | 223 control = "INTERSTITIAL_PAGE"; |
225 break; | 224 break; |
226 default: | 225 default: |
227 control = "UNKNOWN"; | 226 control = "UNKNOWN"; |
228 break; | 227 break; |
229 } | 228 } |
230 | 229 |
231 LogParam(control, l); | 230 LogParam(control, l); |
232 } | 231 } |
233 }; | 232 }; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 LogParam(p.security_style, l); | 512 LogParam(p.security_style, l); |
514 l->append(", "); | 513 l->append(", "); |
515 LogParam(p.displayed_insecure_content, l); | 514 LogParam(p.displayed_insecure_content, l); |
516 l->append(", "); | 515 l->append(", "); |
517 LogParam(p.ran_insecure_content, l); | 516 LogParam(p.ran_insecure_content, l); |
518 l->append(")"); | 517 l->append(")"); |
519 } | 518 } |
520 }; | 519 }; |
521 | 520 |
522 // A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. | 521 // A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. |
523 struct ContextMenuParams { | 522 struct MiniContextMenuParams { |
524 // The x coordinate for displaying the menu. | 523 // The x coordinate for displaying the menu. |
525 int screen_x; | 524 int screen_x; |
526 | 525 |
527 // The y coordinate for displaying the menu. | 526 // The y coordinate for displaying the menu. |
528 int screen_y; | 527 int screen_y; |
529 | 528 |
530 // This is the URL of the link that encloses the node the context menu was | 529 // This is the URL of the link that encloses the node the context menu was |
531 // invoked on. | 530 // invoked on. |
532 GURL link_url; | 531 GURL link_url; |
533 | 532 |
534 // The link URL to be used ONLY for "copy link address". We don't validate | 533 // The link URL to be used ONLY for "copy link address". We don't validate |
535 // this field in the frontend process. | 534 // this field in the frontend process. |
536 GURL unfiltered_link_url; | 535 GURL unfiltered_link_url; |
537 | 536 |
538 // This is the source URL for the element that the context menu was | 537 // This is the source URL for the element that the context menu was |
539 // invoked on. Example of elements with source URLs are img, audio, and | 538 // invoked on. Example of elements with source URLs are img, audio, and |
540 // video. | 539 // video. |
541 GURL src_url; | 540 GURL src_url; |
542 | 541 |
543 // This is the URL of the top level page that the context menu was invoked | 542 // This is the URL of the top level page that the context menu was invoked |
544 // on. | 543 // on. |
545 GURL page_url; | 544 GURL page_url; |
546 | 545 |
547 // This is the URL of the subframe that the context menu was invoked on. | 546 // This is the URL of the subframe that the context menu was invoked on. |
548 GURL frame_url; | 547 GURL frame_url; |
549 }; | 548 }; |
550 | 549 |
551 // Traits for ContextMenuParams structure to pack/unpack. | 550 // Traits for MiniContextMenuParams structure to pack/unpack. |
552 template <> | 551 template <> |
553 struct ParamTraits<ContextMenuParams> { | 552 struct ParamTraits<MiniContextMenuParams> { |
554 typedef ContextMenuParams param_type; | 553 typedef MiniContextMenuParams param_type; |
555 static void Write(Message* m, const param_type& p) { | 554 static void Write(Message* m, const param_type& p) { |
556 WriteParam(m, p.screen_x); | 555 WriteParam(m, p.screen_x); |
557 WriteParam(m, p.screen_y); | 556 WriteParam(m, p.screen_y); |
558 WriteParam(m, p.link_url); | 557 WriteParam(m, p.link_url); |
559 WriteParam(m, p.unfiltered_link_url); | 558 WriteParam(m, p.unfiltered_link_url); |
560 WriteParam(m, p.src_url); | 559 WriteParam(m, p.src_url); |
561 WriteParam(m, p.page_url); | 560 WriteParam(m, p.page_url); |
562 WriteParam(m, p.frame_url); | 561 WriteParam(m, p.frame_url); |
563 } | 562 } |
564 static bool Read(const Message* m, void** iter, param_type* p) { | 563 static bool Read(const Message* m, void** iter, param_type* p) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 LogParam(p.user_gesture, l); | 631 LogParam(p.user_gesture, l); |
633 l->append(","); | 632 l->append(","); |
634 LogParam(p.profile_name, l); | 633 LogParam(p.profile_name, l); |
635 l->append(")"); | 634 l->append(")"); |
636 } | 635 } |
637 }; | 636 }; |
638 | 637 |
639 } // namespace IPC | 638 } // namespace IPC |
640 | 639 |
641 #define MESSAGES_INTERNAL_FILE \ | 640 #define MESSAGES_INTERNAL_FILE \ |
642 "chrome/test/automation/automation_messages_internal.h" | 641 "chrome/common/automation_messages_internal.h" |
643 #include "ipc/ipc_message_macros.h" | 642 #include "ipc/ipc_message_macros.h" |
644 | 643 |
645 #endif // CHROME_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__ | 644 #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ |
OLD | NEW |