| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Defines the IPC messages used by the automation interface. | 5 // Defines the IPC messages used by the automation interface. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "chrome/common/content_settings.h" | 11 #include "chrome/common/content_settings.h" |
| 12 #include "chrome/test/automation/autocomplete_edit_proxy.h" | |
| 13 #include "content/common/navigation_types.h" | 12 #include "content/common/navigation_types.h" |
| 14 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 15 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
| 16 #include "net/url_request/url_request_status.h" | 15 #include "net/url_request/url_request_status.h" |
| 17 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 18 #include "webkit/glue/window_open_disposition.h" | 17 #include "webkit/glue/window_open_disposition.h" |
| 19 | 18 |
| 20 | |
| 21 // NOTE: All IPC messages have either a routing_id of 0 (for asynchronous | 19 // NOTE: All IPC messages have either a routing_id of 0 (for asynchronous |
| 22 // messages), or one that's been assigned by the proxy (for calls | 20 // messages), or one that's been assigned by the proxy (for calls |
| 23 // which expect a response). The routing_id shouldn't be used for | 21 // which expect a response). The routing_id shouldn't be used for |
| 24 // any other purpose in these message types. | 22 // any other purpose in these message types. |
| 25 | 23 |
| 26 // NOTE: All the new IPC messages should go at the end. | 24 // NOTE: All the new IPC messages should go at the end. |
| 27 // The IPC message IDs need to match the reference builds. Since we now | 25 // The IPC message IDs need to match the reference builds. Since we now |
| 28 // define the IDs based on __LINE__, to allow these IPC messages to be | 26 // define the IDs based on __LINE__, to allow these IPC messages to be |
| 29 // used to control an old version of Chrome we need the message IDs to | 27 // used to control an old version of Chrome we need the message IDs to |
| 30 // remain the same. This means that you should not change the line number | 28 // remain the same. This means that you should not change the line number |
| 31 // of any of the messages below. This will be fixed once Xcode supports | 29 // of any of the messages below. This will be fixed once Xcode supports |
| 32 // __COUNTER__, in which case we can get rid of the __LINE__. | 30 // __COUNTER__, in which case we can get rid of the __LINE__. |
| 33 | 31 |
| 32 |
| 33 |
| 34 #define IPC_MESSAGE_START AutomationMsgStart | 34 #define IPC_MESSAGE_START AutomationMsgStart |
| 35 | 35 |
| 36 // This message is fired when the AutomationProvider is up and running | 36 // This message is fired when the AutomationProvider is up and running |
| 37 // in the app (the app is not fully up at this point). The parameter to this | 37 // in the app (the app is not fully up at this point). The parameter to this |
| 38 // message is the version string of the automation provider. This parameter | 38 // message is the version string of the automation provider. This parameter |
| 39 // is defined to be the version string as returned by | 39 // is defined to be the version string as returned by |
| 40 // chrome::VersionInfo::Version(). | 40 // chrome::VersionInfo::Version(). |
| 41 // The client can choose to use this version string to decide whether or not | 41 // The client can choose to use this version string to decide whether or not |
| 42 // it can talk to the provider. | 42 // it can talk to the provider. |
| 43 IPC_MESSAGE_CONTROL1(AutomationMsg_Hello, | 43 IPC_MESSAGE_CONTROL1(AutomationMsg_Hello, |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 int /* browser handle */) | 334 int /* browser handle */) |
| 335 | 335 |
| 336 // This message requests the window associated with the specified browser | 336 // This message requests the window associated with the specified browser |
| 337 // handle. | 337 // handle. |
| 338 // The return value contains a success flag and the handle of the window. | 338 // The return value contains a success flag and the handle of the window. |
| 339 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_WindowForBrowser, | 339 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_WindowForBrowser, |
| 340 int /* browser handle */, | 340 int /* browser handle */, |
| 341 bool /* success flag */, | 341 bool /* success flag */, |
| 342 int /* window handle */) | 342 int /* window handle */) |
| 343 | 343 |
| 344 // This message requests the AutocompleteEdit associated with the specified | 344 // TODO(phajdan.jr): Remove when the reference build is updated (this and |
| 345 // browser handle. | 345 // all others marked "DEPRECATED MESSAGE"). |
| 346 // The return value contains a success flag and the handle of the omnibox. | 346 // (intentionally blank line) |
| 347 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_AutocompleteEditForBrowser, | 347 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_DEPRECATED_AutocompleteEditForBrowser, |
| 348 int /* browser handle */, | 348 int /* browser handle */, |
| 349 bool /* success flag */, | 349 bool /* success flag */, |
| 350 int /* AutocompleteEdit handle */) | 350 int /* AutocompleteEdit handle */) |
| 351 | 351 |
| 352 // This message requests that a mouse click be performed in window coordinate | 352 // This message requests that a mouse click be performed in window coordinate |
| 353 // space. | 353 // space. |
| 354 // Request: | 354 // Request: |
| 355 // int - the handle of the window that's the context for this click | 355 // int - the handle of the window that's the context for this click |
| 356 // gfx::Point - the point to click | 356 // gfx::Point - the point to click |
| 357 // int - the flags which identify the mouse button(s) for the click, as | 357 // int - the flags which identify the mouse button(s) for the click, as |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 // for saving resources. The fourth parameter is the saving type: 0 for HTML | 640 // for saving resources. The fourth parameter is the saving type: 0 for HTML |
| 641 // only; 1 for complete web page. | 641 // only; 1 for complete web page. |
| 642 // The return value contains a bool which is true on success. | 642 // The return value contains a bool which is true on success. |
| 643 IPC_SYNC_MESSAGE_CONTROL4_1(AutomationMsg_SavePage, | 643 IPC_SYNC_MESSAGE_CONTROL4_1(AutomationMsg_SavePage, |
| 644 int, | 644 int, |
| 645 FilePath, | 645 FilePath, |
| 646 FilePath, | 646 FilePath, |
| 647 int, | 647 int, |
| 648 bool) | 648 bool) |
| 649 | 649 |
| 650 // This message requests the text currently being displayed in the | 650 // TODO(phajdan.jr): Remove when the reference build is updated (this and |
| 651 // AutocompleteEdit. The parameter is the handle to the AutocompleteEdit. | 651 // all others marked "DEPRECATED MESSAGE"). |
| 652 // The return value is a string indicating the text in the AutocompleteEdit. | 652 // (intentionally blank line) |
| 653 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_AutocompleteEditGetText, | 653 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_DEPRECATED_AutocompleteEditGetText, |
| 654 int /* autocomplete edit handle */, | 654 int /* autocomplete edit handle */, |
| 655 bool /* the requested autocomplete edit exists */, | 655 bool /* the requested autocomplete edit exists */, |
| 656 string16 /* omnibox text */) | 656 string16 /* omnibox text */) |
| 657 | 657 |
| 658 // This message sets the text being displayed in the AutocompleteEdit. The | 658 // TODO(phajdan.jr): Remove when the reference build is updated (this and |
| 659 // first parameter is the handle to the omnibox and the second parameter is | 659 // all others marked "DEPRECATED MESSAGE"). |
| 660 // the text to be displayed in the AutocompleteEdit. | 660 // (intentionally blank line) |
| 661 // The return value has no parameters and is returned when the operation has | 661 // (intentionally blank line) |
| 662 // completed. | 662 // (intentionally blank line) |
| 663 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_AutocompleteEditSetText, | 663 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_DEPRECATED_AutocompleteEditSetText, |
| 664 int /* autocomplete edit handle */, | 664 int /* autocomplete edit handle */, |
| 665 string16 /* text to set */, | 665 string16 /* text to set */, |
| 666 bool /* the requested autocomplete edit exists */) | 666 bool /* the requested autocomplete edit exists */) |
| 667 | 667 |
| 668 // This message requests if a query to a autocomplete provider is still in | 668 // TODO(phajdan.jr): Remove when the reference build is updated (this and |
| 669 // progress. The first parameter in the request is the handle to the | 669 // all others marked "DEPRECATED MESSAGE"). |
| 670 // autocomplete edit. | 670 // (intentionally blank line) |
| 671 // The first return value indicates if the request succeeded. | 671 // (intentionally blank line) |
| 672 // The second return value indicates if a query is still in progress. | 672 // (intentionally blank line) |
| 673 IPC_SYNC_MESSAGE_CONTROL1_2( \ | 673 IPC_SYNC_MESSAGE_CONTROL1_2( \ |
| 674 AutomationMsg_AutocompleteEditIsQueryInProgress, | 674 AutomationMsg_DEPRECATED_AutocompleteEditIsQueryInProgress, |
| 675 int /* autocomplete edit handle*/, | 675 int /* autocomplete edit handle*/, |
| 676 bool /* the requested autocomplete edit exists */, | 676 bool /* the requested autocomplete edit exists */, |
| 677 bool /* indicates if a query is in progress */) | 677 bool /* indicates if a query is in progress */) |
| 678 | 678 |
| 679 // This message requests a list of the autocomplete messages currently being | 679 // TODO(phajdan.jr): Remove when the reference build is updated (this and |
| 680 // displayed by the popup. The parameter in the request is a handle to the | 680 // all others marked "DEPRECATED MESSAGE"). |
| 681 // autocomplete edit. | 681 // (intentionally blank line) |
| 682 // The first return value indicates if the request was successful, while | 682 // (intentionally blank line) |
| 683 // while the second is the actual list of matches. | 683 // (intentionally blank line) |
| 684 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_AutocompleteEditGetMatches, | 684 IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_DEPRECATED_AutocompleteEditGetMatches, |
| 685 int /* autocomplete edit handle*/, | 685 int /* autocomplete edit handle*/, |
| 686 bool /* the requested autocomplete edit exists */, | 686 bool /* the requested autocomplete edit exists */, |
| 687 std::vector<AutocompleteMatchData> /* matches */) | 687 std::vector<int> /* matches */) |
| 688 | 688 |
| 689 // This message requests the execution of a browser command in the browser | 689 // This message requests the execution of a browser command in the browser |
| 690 // for which the handle is specified. | 690 // for which the handle is specified. |
| 691 // The return value contains a boolean, whether the command was dispatched. | 691 // The return value contains a boolean, whether the command was dispatched. |
| 692 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_WindowExecuteCommandAsync, | 692 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_WindowExecuteCommandAsync, |
| 693 int /* automation handle */, | 693 int /* automation handle */, |
| 694 int /* browser command */, | 694 int /* browser command */, |
| 695 bool /* success flag */) | 695 bool /* success flag */) |
| 696 | 696 |
| 697 // This message requests the execution of a browser command in the browser | 697 // This message requests the execution of a browser command in the browser |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 int /* tab_handle */, | 757 int /* tab_handle */, |
| 758 size_t /* info bar count */) | 758 size_t /* info bar count */) |
| 759 | 759 |
| 760 // This message triggers the action associated with the "accept" button in | 760 // This message triggers the action associated with the "accept" button in |
| 761 // the info-bar at the specified index. If |wait for navigation| is true, it | 761 // the info-bar at the specified index. If |wait for navigation| is true, it |
| 762 // won't return until a navigation has occurred. | 762 // won't return until a navigation has occurred. |
| 763 IPC_SYNC_MESSAGE_CONTROL3_1(AutomationMsg_ClickInfoBarAccept, | 763 IPC_SYNC_MESSAGE_CONTROL3_1(AutomationMsg_ClickInfoBarAccept, |
| 764 int /* tab_handle */, | 764 int /* tab_handle */, |
| 765 size_t /* info bar index */, | 765 size_t /* info bar index */, |
| 766 bool /* wait for navigation */, | 766 bool /* wait for navigation */, |
| 767 // This line blank on purpose, see comment atop file about __LINE__. | 767 // (intentionally blank line), see comment atop file about __LINE__. |
| 768 /* navigation result */ | 768 /* navigation result */ |
| 769 AutomationMsg_NavigationResponseValues) | 769 AutomationMsg_NavigationResponseValues) |
| 770 | 770 |
| 771 // This message retrieves the last time a navigation occurred in the specified | 771 // This message retrieves the last time a navigation occurred in the specified |
| 772 // tab. The value is intended to be used with WaitForNavigation. | 772 // tab. The value is intended to be used with WaitForNavigation. |
| 773 IPC_SYNC_MESSAGE_CONTROL1_1(AutomationMsg_GetLastNavigationTime, | 773 IPC_SYNC_MESSAGE_CONTROL1_1(AutomationMsg_GetLastNavigationTime, |
| 774 int /* tab_handle */, | 774 int /* tab_handle */, |
| 775 int64 /* last navigation time */) | 775 int64 /* last navigation time */) |
| 776 | 776 |
| 777 // This messages is used to block until a new navigation occurs (if there is | 777 // This messages is used to block until a new navigation occurs (if there is |
| 778 // none more recent then the time specified). | 778 // none more recent then the time specified). |
| 779 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_WaitForNavigation, | 779 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_WaitForNavigation, |
| 780 int /* tab_handle */, | 780 int /* tab_handle */, |
| 781 int64 /* last navigation time */, | 781 int64 /* last navigation time */, |
| 782 // This line blank on purpose, see comment atop file about __LINE__. | 782 // (intentionally blank line), see comment atop file about __LINE__. |
| 783 /* navigation result */ | 783 /* navigation result */ |
| 784 AutomationMsg_NavigationResponseValues) | 784 AutomationMsg_NavigationResponseValues) |
| 785 | 785 |
| 786 // This messages sets an int-value preference. | 786 // This messages sets an int-value preference. |
| 787 IPC_SYNC_MESSAGE_CONTROL3_1(AutomationMsg_SetIntPreference, | 787 IPC_SYNC_MESSAGE_CONTROL3_1(AutomationMsg_SetIntPreference, |
| 788 int /* browser handle */, | 788 int /* browser handle */, |
| 789 std::string /* pref name */, | 789 std::string /* pref name */, |
| 790 int /* value */, | 790 int /* value */, |
| 791 bool /* success */) | 791 bool /* success */) |
| 792 | 792 |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 int /* browser handle */, | 1410 int /* browser handle */, |
| 1411 int /* target tab count */, | 1411 int /* target tab count */, |
| 1412 bool /* success */) | 1412 bool /* success */) |
| 1413 | 1413 |
| 1414 // Waits for the infobar count to reach given number. | 1414 // Waits for the infobar count to reach given number. |
| 1415 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_WaitForInfoBarCount, | 1415 IPC_SYNC_MESSAGE_CONTROL2_1(AutomationMsg_WaitForInfoBarCount, |
| 1416 int /* tab handle */, | 1416 int /* tab handle */, |
| 1417 size_t /* target count */, | 1417 size_t /* target count */, |
| 1418 bool /* success */) | 1418 bool /* success */) |
| 1419 | 1419 |
| 1420 // Waits for the autocomplete edit to receive focus. | 1420 // TODO(phajdan.jr): Remove this message. |
| 1421 IPC_SYNC_MESSAGE_CONTROL1_1(AutomationMsg_WaitForAutocompleteEditFocus, | 1421 IPC_SYNC_MESSAGE_CONTROL1_1(AutomationMsg_DEPRECATED_WaitForAutocompleteEditFocu
s, |
| 1422 int /* autocomplete edit handle */, | 1422 int /* autocomplete edit handle */, |
| 1423 bool /* success */) | 1423 bool /* success */) |
| 1424 | 1424 |
| 1425 // Loads all blocked plug-ins on the page. | 1425 // Loads all blocked plug-ins on the page. |
| 1426 IPC_SYNC_MESSAGE_CONTROL1_1(AutomationMsg_LoadBlockedPlugins, | 1426 IPC_SYNC_MESSAGE_CONTROL1_1(AutomationMsg_LoadBlockedPlugins, |
| 1427 int /* tab handle */, | 1427 int /* tab handle */, |
| 1428 bool /* success */) | 1428 bool /* success */) |
| 1429 | 1429 |
| 1430 // TODO(phajdan.jr): Remove this message. | 1430 // TODO(phajdan.jr): Remove this message. |
| 1431 // Captures the entire page for the tab, including those portions not in | 1431 // Captures the entire page for the tab, including those portions not in |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1486 // Sent when the renderer has completed or canceled a client redirect for a | 1486 // Sent when the renderer has completed or canceled a client redirect for a |
| 1487 // particular frame. This message may be sent multiple times for the same | 1487 // particular frame. This message may be sent multiple times for the same |
| 1488 // redirect. | 1488 // redirect. |
| 1489 IPC_MESSAGE_ROUTED1(AutomationMsg_DidCompleteOrCancelClientRedirect, | 1489 IPC_MESSAGE_ROUTED1(AutomationMsg_DidCompleteOrCancelClientRedirect, |
| 1490 int64 /* frame_id */) | 1490 int64 /* frame_id */) |
| 1491 | 1491 |
| 1492 | 1492 |
| 1493 // YOUR NEW MESSAGE MIGHT NOT BELONG HERE. | 1493 // YOUR NEW MESSAGE MIGHT NOT BELONG HERE. |
| 1494 // This is the section for renderer -> browser automation messages. If it is | 1494 // This is the section for renderer -> browser automation messages. If it is |
| 1495 // an automation <-> browser message, put it above this section. | 1495 // an automation <-> browser message, put it above this section. |
| OLD | NEW |