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

Side by Side Diff: components/autofill/core/browser/autofill_regexes.cc

Issue 18252003: Replace third_party/icu/public with third_party/icu/source (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: roll ICU to 211851 Created 7 years, 5 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/core/browser/autofill_regexes.h" 5 #include "components/autofill/core/browser/autofill_regexes.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/singleton.h" 12 #include "base/memory/singleton.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "third_party/icu/public/i18n/unicode/regex.h" 15 #include "third_party/icu/source/i18n/unicode/regex.h"
16 16
17 namespace { 17 namespace {
18 18
19 // A singleton class that serves as a cache of compiled regex patterns. 19 // A singleton class that serves as a cache of compiled regex patterns.
20 class AutofillRegexes { 20 class AutofillRegexes {
21 public: 21 public:
22 static AutofillRegexes* GetInstance(); 22 static AutofillRegexes* GetInstance();
23 23
24 // Returns the compiled regex matcher corresponding to |pattern|. 24 // Returns the compiled regex matcher corresponding to |pattern|.
25 icu::RegexMatcher* GetMatcher(const base::string16& pattern); 25 icu::RegexMatcher* GetMatcher(const base::string16& pattern);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 icu::UnicodeString icu_input(input.data(), input.length()); 75 icu::UnicodeString icu_input(input.data(), input.length());
76 matcher->reset(icu_input); 76 matcher->reset(icu_input);
77 77
78 UErrorCode status = U_ZERO_ERROR; 78 UErrorCode status = U_ZERO_ERROR;
79 UBool match = matcher->find(0, status); 79 UBool match = matcher->find(0, status);
80 DCHECK(U_SUCCESS(status)); 80 DCHECK(U_SUCCESS(status));
81 return !!match; 81 return !!match;
82 } 82 }
83 83
84 } // namespace autofill 84 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_country.cc ('k') | components/autofill/core/browser/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698