OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/android/phone_number_detector.h" | 5 #include "content/renderer/android/phone_number_detector.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "content/public/renderer/android_content_detection_prefixes.h" | 11 #include "content/public/renderer/android_content_detection_prefixes.h" |
12 #include "net/base/escape.h" | 12 #include "net/base/escape.h" |
13 #include "third_party/libphonenumber/src/phonenumber_api.h" | 13 #include "third_party/libphonenumber/phonenumber_api.h" |
14 #include "third_party/libphonenumber/src/phonenumbers/phonenumbermatch.h" | 14 #include "third_party/libphonenumber/src/cpp/src/phonenumbers/phonenumbermatch.h
" |
15 #include "third_party/libphonenumber/src/phonenumbers/phonenumbermatcher.h" | 15 #include "third_party/libphonenumber/src/cpp/src/phonenumbers/phonenumbermatcher
.h" |
16 #include "third_party/libphonenumber/src/phonenumbers/region_code.h" | 16 #include "third_party/libphonenumber/src/cpp/src/phonenumbers/region_code.h" |
17 | 17 |
18 using i18n::phonenumbers::PhoneNumberMatch; | 18 using i18n::phonenumbers::PhoneNumberMatch; |
19 using i18n::phonenumbers::PhoneNumberMatcher; | 19 using i18n::phonenumbers::PhoneNumberMatcher; |
20 using i18n::phonenumbers::PhoneNumberUtil; | 20 using i18n::phonenumbers::PhoneNumberUtil; |
21 using i18n::phonenumbers::RegionCode; | 21 using i18n::phonenumbers::RegionCode; |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // Maximum number of characters to look around for phone number detection. | 25 // Maximum number of characters to look around for phone number detection. |
26 const size_t kMaximumTelephoneLength = 20; | 26 const size_t kMaximumTelephoneLength = 20; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 base::UTF8ToUTF16(utf8_input.substr(0, match.start())).length(); | 84 base::UTF8ToUTF16(utf8_input.substr(0, match.start())).length(); |
85 *end_pos = *start_pos + base::UTF8ToUTF16(match.raw_string()).length(); | 85 *end_pos = *start_pos + base::UTF8ToUTF16(match.raw_string()).length(); |
86 | 86 |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 return false; | 90 return false; |
91 } | 91 } |
92 | 92 |
93 } // namespace content | 93 } // namespace content |
OLD | NEW |