Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / renderer / android / phone_number_detector.h
blob6503eee30b230ebfdf2eef2b4c69bee21d320c86
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.
5 #ifndef CONTENT_RENDERER_ANDROID_PHONE_NUMBER_DETECTOR_H_
6 #define CONTENT_RENDERER_ANDROID_PHONE_NUMBER_DETECTOR_H_
8 #include "base/compiler_specific.h"
9 #include "content/common/content_export.h"
10 #include "content/renderer/android/content_detector.h"
12 namespace content {
14 class PhoneNumberDetectorTest;
16 // Finds a telephone number in the given content text string.
17 class CONTENT_EXPORT PhoneNumberDetector : public ContentDetector {
18 public:
19 PhoneNumberDetector();
20 explicit PhoneNumberDetector(const std::string& region);
21 ~PhoneNumberDetector() override;
23 private:
24 friend class PhoneNumberDetectorTest;
26 // Implementation of ContentDetector.
27 bool FindContent(const base::string16::const_iterator& begin,
28 const base::string16::const_iterator& end,
29 size_t* start_pos,
30 size_t* end_pos,
31 std::string* content_text) override;
32 GURL GetIntentURL(const std::string& content_text) override;
33 size_t GetMaximumContentLength() override;
35 const std::string region_code_;
37 DISALLOW_COPY_AND_ASSIGN(PhoneNumberDetector);
40 } // namespace content
42 #endif // CONTENT_RENDERER_ANDROID_PHONE_NUMBER_DETECTOR_H_