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 CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "content/public/common/page_type.h" | 24 #include "content/public/common/page_type.h" |
25 #include "content/public/common/security_style.h" | 25 #include "content/public/common/security_style.h" |
26 #include "net/base/cert_status_flags.h" | 26 #include "net/base/cert_status_flags.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
28 | 28 |
29 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
30 // TODO(sque): move to a ChromeOS-specific class. See crosbug.com/22081. | 30 // TODO(sque): move to a ChromeOS-specific class. See crosbug.com/22081. |
31 class PowerManagerClientObserverForTesting; | 31 class PowerManagerClientObserverForTesting; |
32 #endif // defined(OS_CHROMEOS) | 32 #endif // defined(OS_CHROMEOS) |
33 | 33 |
34 class AutofillProfile; | |
35 class CreditCard; | 34 class CreditCard; |
36 class ImporterList; | 35 class ImporterList; |
37 | 36 |
38 namespace base { | 37 namespace base { |
39 class DictionaryValue; | 38 class DictionaryValue; |
40 } | 39 } |
41 | 40 |
42 namespace content { | 41 namespace content { |
43 class RenderViewHost; | 42 class RenderViewHost; |
44 struct NativeWebKeyboardEvent; | 43 struct NativeWebKeyboardEvent; |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 void GetTranslateInfo(Browser* browser, | 626 void GetTranslateInfo(Browser* browser, |
628 base::DictionaryValue* args, | 627 base::DictionaryValue* args, |
629 IPC::Message* reply_message); | 628 IPC::Message* reply_message); |
630 | 629 |
631 // Takes the specified action on the translate bar. | 630 // Takes the specified action on the translate bar. |
632 // Uses the JSON interface for input/output. | 631 // Uses the JSON interface for input/output. |
633 void SelectTranslateOption(Browser* browser, | 632 void SelectTranslateOption(Browser* browser, |
634 base::DictionaryValue* args, | 633 base::DictionaryValue* args, |
635 IPC::Message* reply_message); | 634 IPC::Message* reply_message); |
636 | 635 |
637 // Get the profiles that are currently saved to the DB. | |
638 // Uses the JSON interface for input/output. | |
639 void GetAutofillProfile(Browser* browser, | |
640 base::DictionaryValue* args, | |
641 IPC::Message* reply_message); | |
642 | |
643 // Fill in an AutofillProfile with the given profile information. | |
644 // Uses the JSON interface for input/output. | |
645 void FillAutofillProfile(Browser* browser, | |
646 base::DictionaryValue* args, | |
647 IPC::Message* reply_message); | |
648 | |
649 // Injects Javascript into a specified frame that is assumed to submit | |
650 // Autofill data via a webpage form, then waits for Autofill's personal data | |
651 // manager to finish processing the data. | |
652 void SubmitAutofillForm(Browser* browser, | |
653 base::DictionaryValue* args, | |
654 IPC::Message* reply_message); | |
655 | |
656 // Causes the autofill popup to be displayed in an already-focused webpage | |
657 // form field. Waits until the popup is displayed before returning. | |
658 void AutofillTriggerSuggestions(Browser* browser, | |
659 base::DictionaryValue* args, | |
660 IPC::Message* message); | |
661 | |
662 // Highlights the previous or next autofill entry in an already-displayed | |
663 // autofill popup. This is done by sending either an "up arrow" or | |
664 // "down arrow" keypress, then waiting for a preview of the filled-in state | |
665 // to be displayed in the webpage form before returning. Use | |
666 // AutofillTriggerSuggestions() to cause the autofill popup to be displayed. | |
667 void AutofillHighlightSuggestion(Browser* browser, | |
668 base::DictionaryValue* args, | |
669 IPC::Message* message); | |
670 | |
671 // Causes a webpage form to be filled with autofill information from an | |
672 // autofill profile that is already highlighted in an autofill popup. Use | |
673 // AutofillHighlightSuggestion() as needed to highlight the desired profile | |
674 // in the autofill popup. | |
675 void AutofillAcceptSelection(Browser* browser, | |
676 base::DictionaryValue* args, | |
677 IPC::Message* message); | |
678 | |
679 // Signs in to sync using the given username and password. | 636 // Signs in to sync using the given username and password. |
680 // Uses the JSON interface for input/output. | 637 // Uses the JSON interface for input/output. |
681 void SignInToSync(Browser* browser, | 638 void SignInToSync(Browser* browser, |
682 base::DictionaryValue* args, | 639 base::DictionaryValue* args, |
683 IPC::Message* reply_message); | 640 IPC::Message* reply_message); |
684 | 641 |
685 // Returns info about sync. | 642 // Returns info about sync. |
686 // Uses the JSON interface for input/output. | 643 // Uses the JSON interface for input/output. |
687 void GetSyncInfo(Browser* browser, | 644 void GetSyncInfo(Browser* browser, |
688 base::DictionaryValue* args, | 645 base::DictionaryValue* args, |
(...skipping 16 matching lines...) Expand all Loading... |
705 void EnableSyncForDatatypes(Browser* browser, | 662 void EnableSyncForDatatypes(Browser* browser, |
706 base::DictionaryValue* args, | 663 base::DictionaryValue* args, |
707 IPC::Message* reply_message); | 664 IPC::Message* reply_message); |
708 | 665 |
709 // Disables sync for one or more sync datatypes. | 666 // Disables sync for one or more sync datatypes. |
710 // Uses the JSON interface for input/output. | 667 // Uses the JSON interface for input/output. |
711 void DisableSyncForDatatypes(Browser* browser, | 668 void DisableSyncForDatatypes(Browser* browser, |
712 base::DictionaryValue* args, | 669 base::DictionaryValue* args, |
713 IPC::Message* reply_message); | 670 IPC::Message* reply_message); |
714 | 671 |
715 // Translate DictionaryValues of autofill profiles and credit cards to the | |
716 // data structure used in the browser. | |
717 // Args: | |
718 // profiles/cards: the ListValue of profiles/credit cards to translate. | |
719 // error_message: a pointer to the return string in case of error. | |
720 static std::vector<AutofillProfile> GetAutofillProfilesFromList( | |
721 const base::ListValue& profiles, std::string* error_message); | |
722 static std::vector<CreditCard> GetCreditCardsFromList( | |
723 const base::ListValue& cards, std::string* error_message); | |
724 | |
725 // The opposite of the above: translates from the internal data structure | |
726 // for profiles and credit cards to a ListValue of DictionaryValues. The | |
727 // caller owns the returned object. | |
728 static base::ListValue* GetListFromAutofillProfiles( | |
729 const std::vector<AutofillProfile*>& autofill_profiles); | |
730 static base::ListValue* GetListFromCreditCards( | |
731 const std::vector<CreditCard*>& credit_cards); | |
732 | |
733 // Return the map from the internal data representation to the string value | |
734 // of auto fill fields and credit card fields. | |
735 static std::map<AutofillFieldType, std::string> | |
736 GetAutofillFieldToStringMap(); | |
737 static std::map<AutofillFieldType, std::string> | |
738 GetCreditCardFieldToStringMap(); | |
739 | |
740 // Get ordered list of all active and queued HTML5 notifications. | 672 // Get ordered list of all active and queued HTML5 notifications. |
741 // Uses the JSON interface for input/output. | 673 // Uses the JSON interface for input/output. |
742 void GetAllNotifications(Browser* browser, | 674 void GetAllNotifications(Browser* browser, |
743 base::DictionaryValue* args, | 675 base::DictionaryValue* args, |
744 IPC::Message* reply_message); | 676 IPC::Message* reply_message); |
745 | 677 |
746 // Close an active HTML5 notification. | 678 // Close an active HTML5 notification. |
747 // Uses the JSON interface for input/output. | 679 // Uses the JSON interface for input/output. |
748 void CloseNotification(Browser* browser, | 680 void CloseNotification(Browser* browser, |
749 base::DictionaryValue* args, | 681 base::DictionaryValue* args, |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 scoped_ptr<AutomationEventQueue> automation_event_queue_; | 1665 scoped_ptr<AutomationEventQueue> automation_event_queue_; |
1734 | 1666 |
1735 // List of commands which just finish synchronously and don't require | 1667 // List of commands which just finish synchronously and don't require |
1736 // setting up an observer. | 1668 // setting up an observer. |
1737 static const int kSynchronousCommands[]; | 1669 static const int kSynchronousCommands[]; |
1738 | 1670 |
1739 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1671 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
1740 }; | 1672 }; |
1741 | 1673 |
1742 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1674 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
OLD | NEW |