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

Side by Side Diff: components/autofill/content/browser/wallet/required_action.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "components/autofill/content/browser/wallet/required_action.h" 5 #include "components/autofill/content/browser/wallet/required_action.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 9
10 namespace autofill { 10 namespace autofill {
(...skipping 17 matching lines...) Expand all
28 action == ACCEPT_TOS || 28 action == ACCEPT_TOS ||
29 action == GAIA_AUTH || 29 action == GAIA_AUTH ||
30 action == REQUIRE_PHONE_NUMBER || 30 action == REQUIRE_PHONE_NUMBER ||
31 action == UPDATE_EXPIRATION_DATE || 31 action == UPDATE_EXPIRATION_DATE ||
32 action == UPGRADE_MIN_ADDRESS || 32 action == UPGRADE_MIN_ADDRESS ||
33 action == PASSIVE_GAIA_AUTH; 33 action == PASSIVE_GAIA_AUTH;
34 } 34 }
35 35
36 RequiredAction ParseRequiredActionFromString(const std::string& str) { 36 RequiredAction ParseRequiredActionFromString(const std::string& str) {
37 std::string str_lower; 37 std::string str_lower;
38 TrimWhitespaceASCII(StringToLowerASCII(str), TRIM_ALL, &str_lower); 38 base::TrimWhitespaceASCII(StringToLowerASCII(str), base::TRIM_ALL,
39 &str_lower);
39 40
40 if (str_lower == "setup_wallet") 41 if (str_lower == "setup_wallet")
41 return SETUP_WALLET; 42 return SETUP_WALLET;
42 else if (str_lower == "accept_tos") 43 else if (str_lower == "accept_tos")
43 return ACCEPT_TOS; 44 return ACCEPT_TOS;
44 else if (str_lower == "gaia_auth") 45 else if (str_lower == "gaia_auth")
45 return GAIA_AUTH; 46 return GAIA_AUTH;
46 else if (str_lower == "update_expiration_date") 47 else if (str_lower == "update_expiration_date")
47 return UPDATE_EXPIRATION_DATE; 48 return UPDATE_EXPIRATION_DATE;
48 else if (str_lower == "upgrade_min_address") 49 else if (str_lower == "upgrade_min_address")
49 return UPGRADE_MIN_ADDRESS; 50 return UPGRADE_MIN_ADDRESS;
50 else if (str_lower == "invalid_form_field") 51 else if (str_lower == "invalid_form_field")
51 return INVALID_FORM_FIELD; 52 return INVALID_FORM_FIELD;
52 else if (str_lower == "verify_cvv") 53 else if (str_lower == "verify_cvv")
53 return VERIFY_CVV; 54 return VERIFY_CVV;
54 else if (str_lower == "passive_gaia_auth") 55 else if (str_lower == "passive_gaia_auth")
55 return PASSIVE_GAIA_AUTH; 56 return PASSIVE_GAIA_AUTH;
56 else if (str_lower == "require_phone_number") 57 else if (str_lower == "require_phone_number")
57 return REQUIRE_PHONE_NUMBER; 58 return REQUIRE_PHONE_NUMBER;
58 else if (str_lower == "choose_another_instrument_or_address") 59 else if (str_lower == "choose_another_instrument_or_address")
59 return CHOOSE_ANOTHER_INSTRUMENT_OR_ADDRESS; 60 return CHOOSE_ANOTHER_INSTRUMENT_OR_ADDRESS;
60 61
61 DLOG(ERROR) << "Failed to parse: \"" << str << "\" as a required action"; 62 DLOG(ERROR) << "Failed to parse: \"" << str << "\" as a required action";
62 return UNKNOWN_TYPE; 63 return UNKNOWN_TYPE;
63 } 64 }
64 65
65 } // namespace wallet 66 } // namespace wallet
66 } // namespace autofill 67 } // namespace autofill
OLDNEW
« no previous file with comments | « chromeos/system/name_value_pairs_parser.cc ('k') | components/autofill/content/browser/wallet/wallet_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698