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

Unified Diff: components/autofill/browser/phone_field.h

Issue 17392006: In components/autofill, move browser/ to core/browser/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to fix conflicts Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/browser/phone_field.h
diff --git a/components/autofill/browser/phone_field.h b/components/autofill/browser/phone_field.h
deleted file mode 100644
index e82c1e366ec645da30917b0c6b38b03af9ff36fa..0000000000000000000000000000000000000000
--- a/components/autofill/browser/phone_field.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_AUTOFILL_BROWSER_PHONE_FIELD_H_
-#define COMPONENTS_AUTOFILL_BROWSER_PHONE_FIELD_H_
-
-#include <vector>
-
-#include "base/compiler_specific.h"
-#include "components/autofill/browser/autofill_type.h"
-#include "components/autofill/browser/form_field.h"
-#include "components/autofill/browser/phone_number.h"
-
-namespace autofill {
-
-class AutofillField;
-class AutofillScanner;
-
-// A phone number in one of the following formats:
-// - area code, prefix, suffix
-// - area code, number
-// - number
-class PhoneField : public FormField {
- public:
- virtual ~PhoneField();
-
- static FormField* Parse(AutofillScanner* scanner);
-
- protected:
- // FormField:
- virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE;
-
- private:
- FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ParseOneLinePhone);
- FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ParseTwoLinePhone);
- FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumber);
- FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix);
- FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix2);
- FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, CountryAndCityAndPhoneNumber);
-
- // This is for easy description of the possible parsing paths of the phone
- // fields.
- enum RegexType {
- REGEX_COUNTRY,
- REGEX_AREA,
- REGEX_AREA_NOTEXT,
- REGEX_PHONE,
- REGEX_PREFIX_SEPARATOR,
- REGEX_PREFIX,
- REGEX_SUFFIX_SEPARATOR,
- REGEX_SUFFIX,
- REGEX_EXTENSION,
-
- // Separates regexps in grammar.
- REGEX_SEPARATOR,
- };
-
- // Parsed fields.
- enum PhonePart {
- FIELD_NONE = -1,
- FIELD_COUNTRY_CODE,
- FIELD_AREA_CODE,
- FIELD_PHONE,
- FIELD_SUFFIX,
- FIELD_EXTENSION,
-
- FIELD_MAX,
- };
-
- struct Parser {
- RegexType regex; // Field matching reg-ex.
- PhonePart phone_part; // Index of the field.
- size_t max_size; // Max size of the field to match. 0 means any.
- };
-
- static const Parser kPhoneFieldGrammars[];
-
- PhoneField();
-
- // Returns the regular expression string correspoding to |regex_id|
- static base::string16 GetRegExp(RegexType regex_id);
-
- // FIELD_PHONE is always present; holds suffix if prefix is present.
- // The rest could be NULL.
- const AutofillField* parsed_phone_fields_[FIELD_MAX];
-
- DISALLOW_COPY_AND_ASSIGN(PhoneField);
-};
-
-} // namespace autofill
-
-#endif // COMPONENTS_AUTOFILL_BROWSER_PHONE_FIELD_H_
« no previous file with comments | « components/autofill/browser/personal_data_manager_unittest.cc ('k') | components/autofill/browser/phone_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698