diff options
author | tyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 09:57:58 +0000 |
---|---|---|
committer | tyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 09:57:58 +0000 |
commit | 1ac875d29da54823e8070bb64457aa542f8cd30b (patch) | |
tree | 85c1ca275d55885f86001dcdffa53e4dabe98e37 /chrome/browser/automation/automation_provider.h | |
parent | a4219b283fd202372e82ac3d9f167b83629cfbfa (diff) | |
download | chromium_src-1ac875d29da54823e8070bb64457aa542f8cd30b.zip chromium_src-1ac875d29da54823e8070bb64457aa542f8cd30b.tar.gz chromium_src-1ac875d29da54823e8070bb64457aa542f8cd30b.tar.bz2 |
Revert 52628 - Refactor json automation interface for pyauto hooks.
Reduces the number of lines you need to add per new automation hook. Shaves
off several lines of code.
Refactor pyauto.py to obviate raising exception in case the json interfaces produces an error string.
Reason: since startup_test of XP Perf and Vista Perf failed around this change and
this change touched automated test
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=52054
Review URL: http://codereview.chromium.org/2898001
TBR=nirnimesh@chromium.org
Review URL: http://codereview.chromium.org/2812057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider.h')
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 524fd62..a0d2dd7 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -476,11 +476,11 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, // data structure used in the browser. // Args: // profiles/cards: the ListValue of profiles/credit cards to translate. - // error_message: a pointer to the return string in case of error. + // json_return: a pointer to the return string in case of error. static std::vector<AutoFillProfile> GetAutoFillProfilesFromList( - const ListValue& profiles, std::string* error_message); + const ListValue& profiles, std::string* json_return); static std::vector<CreditCard> GetCreditCardsFromList( - const ListValue& cards, std::string* error_message); + const ListValue& cards, std::string* json_return); // The opposite of the above: translates from the internal data structure // for profiles and credit cards to a ListValue of DictionaryValues. The @@ -497,6 +497,10 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, static std::map<AutoFillFieldType, std::wstring> GetCreditCardFieldToStringMap(); + // Util for creating a JSON error return string (dict with key + // 'error' and error string value). No need to quote input. + static std::string JSONErrorString(const std::string& err); + // Generic pattern for pyautolib // Uses the JSON interface for input/output. void SendJSONRequest(int handle, |