| 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_ADDRESS_DETECTOR_H_ | |
| 6 #define CONTENT_RENDERER_ANDROID_ADDRESS_DETECTOR_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "content/renderer/android/content_detector.h" | |
| 13 #include "url/gurl.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 // Finds a geographical address (currently US only) in the given text string. | |
| 18 class AddressDetector : public ContentDetector { | |
| 19 public: | |
| 20 AddressDetector(); | |
| 21 ~AddressDetector() override; | |
| 22 | |
| 23 private: | |
| 24 // Implementation of ContentDetector. | |
| 25 bool FindContent(const base::string16::const_iterator& begin, | |
| 26 const base::string16::const_iterator& end, | |
| 27 size_t* start_pos, | |
| 28 size_t* end_pos, | |
| 29 std::string* content_text) override; | |
| 30 GURL GetIntentURL(const std::string& content_text) override; | |
| 31 size_t GetMaximumContentLength() override; | |
| 32 | |
| 33 std::string GetContentText(const base::string16& text); | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(AddressDetector); | |
| 36 }; | |
| 37 | |
| 38 } // namespace content | |
| 39 | |
| 40 #endif // CONTENT_RENDERER_ANDROID_ADDRESS_DETECTOR_H_ | |
| OLD | NEW |