summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorleandrogracia@chromium.org <leandrogracia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-28 12:30:37 +0000
committerleandrogracia@chromium.org <leandrogracia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-28 12:30:37 +0000
commit08e1a253b5eca28666569e05cbf4552127aa2568 (patch)
tree4664cee6fb73940b1343718ad1e4309cbc732ea9 /content
parent8e6e48fd1ece031b0f189a6c8f020730d0d1ff69 (diff)
downloadchromium_src-08e1a253b5eca28666569e05cbf4552127aa2568.zip
chromium_src-08e1a253b5eca28666569e05cbf4552127aa2568.tar.gz
chromium_src-08e1a253b5eca28666569e05cbf4552127aa2568.tar.bz2
Fix content detector nits.
Fix the nits detected in https://chromiumcodereview.appspot.com/10187020/ after the patch was landed and the bug closed. BUG=125390 TEST=Unit tests of each component (address/phone number/email). Review URL: https://chromiumcodereview.appspot.com/10443031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/content_renderer.gypi4
-rw-r--r--content/renderer/android/content_detector.cc3
-rw-r--r--content/renderer/android/content_detector.h21
3 files changed, 13 insertions, 15 deletions
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index 74c7719..a0ddc25 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -40,6 +40,8 @@
'public/renderer/render_view_observer_tracker.h',
'public/renderer/render_view_visitor.h',
'public/renderer/v8_value_converter.h',
+ 'renderer/active_notification_tracker.cc',
+ 'renderer/active_notification_tracker.h',
'renderer/android/address_detector.cc',
'renderer/android/address_detector.h',
'renderer/android/content_detector.cc',
@@ -48,8 +50,6 @@
'renderer/android/email_detector.h',
'renderer/android/phone_number_detector.cc',
'renderer/android/phone_number_detector.h',
- 'renderer/active_notification_tracker.cc',
- 'renderer/active_notification_tracker.h',
'renderer/device_orientation_dispatcher.cc',
'renderer/device_orientation_dispatcher.h',
'renderer/devtools_agent.cc',
diff --git a/content/renderer/android/content_detector.cc b/content/renderer/android/content_detector.cc
index 5c184c9..2476d26 100644
--- a/content/renderer/android/content_detector.cc
+++ b/content/renderer/android/content_detector.cc
@@ -27,7 +27,8 @@ ContentDetector::Result ContentDetector::FindTappedContent(
}
WebRange ContentDetector::FindContentRange(
- const WebKit::WebHitTestResult& hit_test, std::string* content_text) {
+ const WebKit::WebHitTestResult& hit_test,
+ std::string* content_text) {
// As the surrounding text extractor looks at maxLength/2 characters on
// either side of the hit point, we need to double max content length here.
WebSurroundingText surrounding_text;
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);