summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-18 08:20:38 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-18 08:20:38 +0000
commita2cf65eb3c1b4433078eabba9d92dc2299d3cce3 (patch)
tree11f89d7a5dc9e2896b34a55a40dbedeef95a7013 /chrome/browser/tab_contents
parent145eeb2d81d560a2b972bbbf83a81e9e9e4efb17 (diff)
downloadchromium_src-a2cf65eb3c1b4433078eabba9d92dc2299d3cce3.zip
chromium_src-a2cf65eb3c1b4433078eabba9d92dc2299d3cce3.tar.gz
chromium_src-a2cf65eb3c1b4433078eabba9d92dc2299d3cce3.tar.bz2
Moving the page contents message processing to the RenderViewHost.
It was currently processed as a control message. This is an actual part of the previous CLD related CL: http://codereview.chromium.org/548057 It kept failing on the bots for some tests, I am not sure why yet and cannot repro locally. Hopefully splitting it will help pinpoint the issue. TEST=All unit-tests, ui tests should still work. Navigate to a page with some specific words in it, then go to the history tab and search for pages with these specific words. Make sure the page you navigated is shown in the results. TBR=brettw Review URL: http://codereview.chromium.org/553012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc20
-rw-r--r--chrome/browser/tab_contents/tab_contents.h4
2 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index fdfa5ab..4474458 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1760,6 +1760,26 @@ void TabContents::OnDidGetApplicationInfo(
delegate()->OnDidGetApplicationInfo(this, page_id);
}
+void TabContents::OnPageContents(const GURL& url,
+ int renderer_process_id,
+ int32 page_id,
+ const std::wstring& contents) {
+ // Don't index any https pages. People generally don't want their bank
+ // accounts, etc. indexed on their computer, especially since some of these
+ // things are not marked cachable.
+ // TODO(brettw) we may want to consider more elaborate heuristics such as
+ // the cachability of the page. We may also want to consider subframes (this
+ // test will still index subframes if the subframe is SSL).
+ if (!url.SchemeIsSecure()) {
+ Profile* p = profile();
+ if (p && !p->IsOffTheRecord()) {
+ HistoryService* hs = p->GetHistoryService(Profile::IMPLICIT_ACCESS);
+ if (hs)
+ hs->SetPageContents(url, contents);
+ }
+ }
+}
+
void TabContents::DidStartProvisionalLoadForFrame(
RenderViewHost* render_view_host,
bool is_main_frame,
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index de1e3ab..fb8597e 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -814,6 +814,10 @@ class TabContents : public PageNavigator,
virtual void OnDidGetApplicationInfo(
int32 page_id,
const webkit_glue::WebApplicationInfo& info);
+ virtual void OnPageContents(const GURL& url,
+ int renderer_process_id,
+ int32 page_id,
+ const std::wstring& contents);
// RenderViewHostDelegate::Resource implementation.
virtual void DidStartProvisionalLoadForFrame(RenderViewHost* render_view_host,