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

Side by Side Diff: chrome/browser/autofill/credit_card.cc

Issue 6484022: Autofill i18n: Set postal code and state field labels based on the selected country. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Still needs tests Created 9 years, 10 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/autofill/credit_card.h" 5 #include "chrome/browser/autofill/credit_card.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 NOTREACHED(); 321 NOTREACHED();
322 break; 322 break;
323 323
324 default: 324 default:
325 DLOG(ERROR) << "Attempting to set unknown info-type " 325 DLOG(ERROR) << "Attempting to set unknown info-type "
326 << type.field_type(); 326 << type.field_type();
327 break; 327 break;
328 } 328 }
329 } 329 }
330 330
331 const string16 CreditCard::Label() const { 331 string16 CreditCard::Label() const {
332 return label_; 332 return label_;
333 } 333 }
334 334
335 void CreditCard::SetInfoForMonthInputType(const string16& value) { 335 void CreditCard::SetInfoForMonthInputType(const string16& value) {
336 // Check if |text| is "yyyy-mm" format first, and check normal month format. 336 // Check if |text| is "yyyy-mm" format first, and check normal month format.
337 WebKit::WebRegularExpression re(WebKit::WebString("^[0-9]{4}\\-[0-9]{1,2}$"), 337 WebKit::WebRegularExpression re(WebKit::WebString("^[0-9]{4}\\-[0-9]{1,2}$"),
338 WebKit::WebTextCaseInsensitive); 338 WebKit::WebTextCaseInsensitive);
339 bool match = re.match(WebKit::WebString(StringToLowerASCII(value))) != -1; 339 bool match = re.match(WebKit::WebString(StringToLowerASCII(value))) != -1;
340 if (match) { 340 if (match) {
341 std::vector<string16> year_month; 341 std::vector<string16> year_month;
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 // send these strings to WK, which then asks WebKitClientImpl to load the image 659 // send these strings to WK, which then asks WebKitClientImpl to load the image
660 // data. 660 // data.
661 const char* const kAmericanExpressCard = "americanExpressCC"; 661 const char* const kAmericanExpressCard = "americanExpressCC";
662 const char* const kDinersCard = "dinersCC"; 662 const char* const kDinersCard = "dinersCC";
663 const char* const kDiscoverCard = "discoverCC"; 663 const char* const kDiscoverCard = "discoverCC";
664 const char* const kGenericCard = "genericCC"; 664 const char* const kGenericCard = "genericCC";
665 const char* const kJCBCard = "jcbCC"; 665 const char* const kJCBCard = "jcbCC";
666 const char* const kMasterCard = "masterCardCC"; 666 const char* const kMasterCard = "masterCardCC";
667 const char* const kSoloCard = "soloCC"; 667 const char* const kSoloCard = "soloCC";
668 const char* const kVisaCard = "visaCC"; 668 const char* const kVisaCard = "visaCC";
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698