OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/phone_field.h" | 5 #include "chrome/browser/autofill/phone_field.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 ParseText(scanner, phone_field->GetExtensionRegex(), | 320 ParseText(scanner, phone_field->GetExtensionRegex(), |
321 &phone_field->parsed_phone_fields_[FIELD_EXTENSION]); | 321 &phone_field->parsed_phone_fields_[FIELD_EXTENSION]); |
322 | 322 |
323 return true; | 323 return true; |
324 } | 324 } |
325 | 325 |
326 void PhoneField::SetPhoneType(PhoneType phone_type) { | 326 void PhoneField::SetPhoneType(PhoneType phone_type) { |
327 // Field types are different as well, so we create a temporary phone number, | 327 // Field types are different as well, so we create a temporary phone number, |
328 // to get relevant field types. | 328 // to get relevant field types. |
329 if (phone_type == HOME_PHONE) | 329 if (phone_type == HOME_PHONE) |
330 number_.reset(new HomePhoneNumber); | 330 number_.reset(new PhoneNumber(AutofillType::PHONE_HOME)); |
331 else | 331 else |
332 number_.reset(new FaxNumber); | 332 number_.reset(new PhoneNumber(AutofillType::PHONE_FAX)); |
333 phone_type_ = phone_type; | 333 phone_type_ = phone_type; |
334 } | 334 } |
335 | 335 |
OLD | NEW |