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

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

Issue 22009003: [Autofill] Distinguish between native field types and potentially HTML field types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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/form_field_error.h" 5 #include "components/autofill/content/browser/wallet/form_field_error.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 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 } // namespace 51 } // namespace
52 52
53 FormFieldError::FormFieldError(ErrorType error_type, Location location) 53 FormFieldError::FormFieldError(ErrorType error_type, Location location)
54 : error_type_(error_type), 54 : error_type_(error_type),
55 location_(location) {} 55 location_(location) {}
56 56
57 FormFieldError::~FormFieldError() {} 57 FormFieldError::~FormFieldError() {}
58 58
59 AutofillFieldType FormFieldError::GetAutofillType() const { 59 ServerFieldType FormFieldError::GetAutofillType() const {
60 switch (error_type_) { 60 switch (error_type_) {
61 case INVALID_PHONE_NUMBER: 61 case INVALID_PHONE_NUMBER:
62 if (location_ == LEGAL_ADDRESS || location_ == PAYMENT_INSTRUMENT) 62 if (location_ == LEGAL_ADDRESS || location_ == PAYMENT_INSTRUMENT)
63 return PHONE_BILLING_WHOLE_NUMBER; 63 return PHONE_BILLING_WHOLE_NUMBER;
64 if (location_ == SHIPPING_ADDRESS) 64 if (location_ == SHIPPING_ADDRESS)
65 return PHONE_HOME_WHOLE_NUMBER; 65 return PHONE_HOME_WHOLE_NUMBER;
66 break; 66 break;
67 67
68 case INVALID_POSTAL_CODE: 68 case INVALID_POSTAL_CODE:
69 case INVALID_CITY: 69 case INVALID_CITY:
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 return form_field_error; 146 return form_field_error;
147 } 147 }
148 148
149 bool FormFieldError::operator==(const FormFieldError& other) const { 149 bool FormFieldError::operator==(const FormFieldError& other) const {
150 return error_type_ == other.error_type_ && location_ == other.location_; 150 return error_type_ == other.error_type_ && location_ == other.location_;
151 } 151 }
152 152
153 } // namespace wallet 153 } // namespace wallet
154 } // namespace autofill 154 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698