Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1761)

Unified Diff: chrome/browser/prerender/prerender_tab_helper.h

Issue 10316020: Remove WebContentsImpl::OnDidRedirectProvisionalLoad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move redirect handling into a helper method. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prerender/prerender_tab_helper.h
diff --git a/chrome/browser/prerender/prerender_tab_helper.h b/chrome/browser/prerender/prerender_tab_helper.h
index 7baccbcc06c2104386223849e5803e38b54800c3..f55f5c11cc9e12d132833227c5c650c78251b9eb 100644
--- a/chrome/browser/prerender/prerender_tab_helper.h
+++ b/chrome/browser/prerender/prerender_tab_helper.h
@@ -7,6 +7,8 @@
#include "base/time.h"
#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
#include "googleurl/src/gurl.h"
@@ -18,16 +20,13 @@ class PrerenderManager;
// PrerenderTabHelper is responsible for recording perceived pageload times
// to compare PLT's with prerendering enabled and disabled.
-class PrerenderTabHelper : public content::WebContentsObserver {
+class PrerenderTabHelper : public content::NotificationObserver,
+ public content::WebContentsObserver {
public:
explicit PrerenderTabHelper(TabContentsWrapper* tab);
virtual ~PrerenderTabHelper();
// content::WebContentsObserver implementation.
- virtual void ProvisionalChangeToMainFrameUrl(
- const GURL& url,
- const GURL& opener_url,
- content::RenderViewHost* render_view_host) OVERRIDE;
virtual void DidStopLoading() OVERRIDE;
virtual void DidStartProvisionalLoadForFrame(
int64 frame_id,
@@ -44,6 +43,11 @@ class PrerenderTabHelper : public content::WebContentsObserver {
// Called when this prerendered TabContents has just been swapped in.
void PrerenderSwappedIn();
+ // content::NotificationObserver
cbentzel 2012/05/17 18:52:05 Why did this move to the public interface in this
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
private:
// Helper class to compute pixel-based stats on the paint progress
// between when a prerendered page is swapped in and when the onload event
@@ -62,6 +66,8 @@ class PrerenderTabHelper : public content::WebContentsObserver {
bool IsTopSite(const GURL& url);
+ void HandleResourceReceivedRedirect(const GURL& new_url);
+
// TabContentsWrapper we're created for.
TabContentsWrapper* tab_;
@@ -77,6 +83,8 @@ class PrerenderTabHelper : public content::WebContentsObserver {
// Current URL being loaded.
GURL url_;
+ content::NotificationRegistrar notification_registrar_;
+
DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper);
};
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_tab_helper.cc » ('j') | chrome/browser/prerender/prerender_tab_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698