Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / renderer / android / address_detector.h
blobeea777f132992ccd4ff899f2005e43aed2d1a751
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_ADDRESS_DETECTOR_H_
6 #define CONTENT_RENDERER_ANDROID_ADDRESS_DETECTOR_H_
8 #include "base/compiler_specific.h"
9 #include "content/renderer/android/content_detector.h"
10 #include "url/gurl.h"
12 namespace content {
14 // Finds a geographical address (currently US only) in the given text string.
15 class AddressDetector : public ContentDetector {
16 public:
17 AddressDetector();
18 virtual ~AddressDetector();
20 private:
21 // Implementation of ContentDetector.
22 virtual bool FindContent(const base::string16::const_iterator& begin,
23 const base::string16::const_iterator& end,
24 size_t* start_pos,
25 size_t* end_pos,
26 std::string* content_text) OVERRIDE;
27 virtual GURL GetIntentURL(const std::string& content_text) OVERRIDE;
28 virtual size_t GetMaximumContentLength() OVERRIDE;
30 std::string GetContentText(const base::string16& text);
32 DISALLOW_COPY_AND_ASSIGN(AddressDetector);
35 } // namespace content
37 #endif // CONTENT_RENDERER_ANDROID_ADDRESS_DETECTOR_H_