Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Side by Side Diff: chrome/test/automation/automation_messages.h

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

Powered by Google App Engine
This is Rietveld 408576698