summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 19:56:14 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 19:56:14 +0000
commitf72298c8e0ce1427e8ed682ca5dad0573d6c2763 (patch)
tree842b5af9151d68cb51acf5c113d09e43fca703a8 /content
parent6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24 (diff)
downloadchromium_src-f72298c8e0ce1427e8ed682ca5dad0573d6c2763.zip
chromium_src-f72298c8e0ce1427e8ed682ca5dad0573d6c2763.tar.gz
chromium_src-f72298c8e0ce1427e8ed682ca5dad0573d6c2763.tar.bz2
Add an icon to the omnibox when a page is prerendered.
This will only show up for users who have prerendering enabled (mainly via about:flags) This CL does not include the logic for displaying whether prerender failed on the referring page. BUG=73065 TEST=Start Chrome with prerendering enabled, go to a page with a <link rel=prefetch> element, navigate to the referred page, and see icon appear. Review URL: http://codereview.chromium.org/6529031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/tab_contents/tab_contents.cc5
-rw-r--r--content/browser/tab_contents/tab_contents.h6
2 files changed, 10 insertions, 1 deletions
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 30b91e9..7f8814c 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -279,7 +279,8 @@ TabContents::TabContents(Profile* profile,
maximum_zoom_percent_(
static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)),
temporary_zoom_settings_(false),
- content_restrictions_(0) {
+ content_restrictions_(0),
+ was_prerendered_(false) {
renderer_preferences_util::UpdateFromSystemSettings(
&renderer_preferences_, profile);
@@ -1376,6 +1377,8 @@ void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id,
if (!is_error_page)
content_settings_delegate_->ClearCookieSpecificContentSettings();
content_settings_delegate_->ClearGeolocationContentSettings();
+ // TODO(cbentzel): Should error pages still show prerendered icon?
+ set_was_prerendered(false);
// Check if the URL we are about to load has been prerendered by any chance,
// and use it if possible.
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 318e9fc..a419434 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -715,6 +715,9 @@ class TabContents : public PageNavigator,
return safebrowsing_detection_host_.get();
}
+ bool was_prerendered() const { return was_prerendered_; }
+ void set_was_prerendered(bool prerendered) { was_prerendered_ = prerendered; }
+
protected:
// from RenderViewHostDelegate.
virtual bool OnMessageReceived(const IPC::Message& message);
@@ -1252,6 +1255,9 @@ class TabContents : public PageNavigator,
// (full-page plugins for now only) permissions.
int content_restrictions_;
+ // Were the contents of this tab previously prerendered?
+ bool was_prerendered_;
+
DISALLOW_COPY_AND_ASSIGN(TabContents);
};