diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 07:35:57 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 07:35:57 +0000 |
commit | 3b9a9abc81f3223207ef9fc1d9c9104c0220d873 (patch) | |
tree | 142e4a7919c21f55d0f5fcb8cef122a7b43894f4 /chrome/browser/automation/automation_provider.h | |
parent | 4d666e784754ed2f3f72bdafd875101dee021429 (diff) | |
download | chromium_src-3b9a9abc81f3223207ef9fc1d9c9104c0220d873.zip chromium_src-3b9a9abc81f3223207ef9fc1d9c9104c0220d873.tar.gz chromium_src-3b9a9abc81f3223207ef9fc1d9c9104c0220d873.tar.bz2 |
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.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=52054
Review URL: http://codereview.chromium.org/2898001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52628 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, 3 insertions, 7 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index a0d2dd7..524fd62 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. - // json_return: a pointer to the return string in case of error. + // error_message: a pointer to the return string in case of error. static std::vector<AutoFillProfile> GetAutoFillProfilesFromList( - const ListValue& profiles, std::string* json_return); + const ListValue& profiles, std::string* error_message); static std::vector<CreditCard> GetCreditCardsFromList( - const ListValue& cards, std::string* json_return); + const ListValue& cards, std::string* error_message); // The opposite of the above: translates from the internal data structure // for profiles and credit cards to a ListValue of DictionaryValues. The @@ -497,10 +497,6 @@ 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, |