summaryrefslogtreecommitdiffstats
path: root/content/renderer/android/content_detector.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/android/content_detector.h')
-rw-r--r--content/renderer/android/content_detector.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/content/renderer/android/content_detector.h b/content/renderer/android/content_detector.h
index 5a7b5fd..4e3db20 100644
--- a/content/renderer/android/content_detector.h
+++ b/content/renderer/android/content_detector.h
@@ -6,9 +6,7 @@
#define CONTENT_RENDERER_ANDROID_CONTENT_DETECTOR_H_
#pragma once
-#include "base/string_util.h"
#include "googleurl/src/gurl.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h"
namespace WebKit {
@@ -20,23 +18,21 @@ namespace content {
// Base class for text-based content detectors.
class ContentDetector {
public:
-
// Holds the content detection results.
struct Result {
- bool valid; // Flag indicating if the result is valid.
- WebKit::WebRange range; // Range describing the content boundaries.
- std::string text; // Processed text of the content.
- GURL intent_url; // URL of the intent that should process this content.
-
Result() : valid(false) {}
-
- Result(const WebKit::WebRange& range,
+ Result(const WebKit::WebRange& content_boundaries,
const std::string& text,
const GURL& intent_url)
: valid(true),
- range(range),
+ content_boundaries(content_boundaries),
text(text),
intent_url(intent_url) {}
+
+ bool valid;
+ WebKit::WebRange content_boundaries;
+ std::string text; // Processed text of the content.
+ GURL intent_url; // URL of the intent that should process this content.
};
virtual ~ContentDetector() {}
@@ -46,6 +42,8 @@ class ContentDetector {
Result FindTappedContent(const WebKit::WebHitTestResult& hit_test);
protected:
+ ContentDetector() {}
+
// Parses the input string defined by the begin/end iterators returning true
// if the desired content is found. The start and end positions relative to
// the input iterators are returned in start_pos and end_pos.
@@ -63,7 +61,6 @@ class ContentDetector {
// position in order to search for content.
virtual size_t GetMaximumContentLength() = 0;
- ContentDetector() {}
WebKit::WebRange FindContentRange(const WebKit::WebHitTestResult& hit_test,
std::string* content_text);