| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_RENDERER_ANDROID_PHONE_NUMBER_DETECTOR_H_ | |
| 6 #define CONTENT_RENDERER_ANDROID_PHONE_NUMBER_DETECTOR_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "content/common/content_export.h" | |
| 13 #include "content/renderer/android/content_detector.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 class PhoneNumberDetectorTest; | |
| 18 | |
| 19 // Finds a telephone number in the given content text string. | |
| 20 class CONTENT_EXPORT PhoneNumberDetector : public ContentDetector { | |
| 21 public: | |
| 22 PhoneNumberDetector(); | |
| 23 explicit PhoneNumberDetector(const std::string& region); | |
| 24 ~PhoneNumberDetector() override; | |
| 25 | |
| 26 private: | |
| 27 friend class PhoneNumberDetectorTest; | |
| 28 | |
| 29 // Implementation of ContentDetector. | |
| 30 bool FindContent(const base::string16::const_iterator& begin, | |
| 31 const base::string16::const_iterator& end, | |
| 32 size_t* start_pos, | |
| 33 size_t* end_pos, | |
| 34 std::string* content_text) override; | |
| 35 GURL GetIntentURL(const std::string& content_text) override; | |
| 36 size_t GetMaximumContentLength() override; | |
| 37 | |
| 38 const std::string region_code_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(PhoneNumberDetector); | |
| 41 }; | |
| 42 | |
| 43 } // namespace content | |
| 44 | |
| 45 #endif // CONTENT_RENDERER_ANDROID_PHONE_NUMBER_DETECTOR_H_ | |
| OLD | NEW |