summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prerender/prerender_tab_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/prerender/prerender_tab_helper.h')
-rw-r--r--chrome/browser/prerender/prerender_tab_helper.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome/browser/prerender/prerender_tab_helper.h b/chrome/browser/prerender/prerender_tab_helper.h
index 4c47e3b..92fa567 100644
--- a/chrome/browser/prerender/prerender_tab_helper.h
+++ b/chrome/browser/prerender/prerender_tab_helper.h
@@ -6,11 +6,16 @@
#define CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/time.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
#include "googleurl/src/gurl.h"
+namespace predictors {
+class LoggedInPredictorTable;
+}
+
namespace prerender {
class PrerenderManager;
@@ -21,6 +26,17 @@ class PrerenderTabHelper
: public content::WebContentsObserver,
public content::WebContentsUserData<PrerenderTabHelper> {
public:
+ enum Event {
+ EVENT_LOGGED_IN_TABLE_REQUESTED = 0,
+ EVENT_LOGGED_IN_TABLE_PRESENT = 1,
+ EVENT_MAINFRAME_CHANGE = 2,
+ EVENT_MAINFRAME_CHANGE_DOMAIN_LOGGED_IN = 3,
+ EVENT_MAINFRAME_COMMIT = 4,
+ EVENT_MAINFRAME_COMMIT_DOMAIN_LOGGED_IN = 5,
+ EVENT_LOGIN_ACTION_ADDED = 6,
+ EVENT_MAX_VALUE
+ };
+
virtual ~PrerenderTabHelper();
// content::WebContentsObserver implementation.
@@ -43,6 +59,10 @@ class PrerenderTabHelper
const GURL& validated_url,
content::PageTransition transition_type,
content::RenderViewHost* render_view_host) OVERRIDE;
+ virtual void DidNavigateAnyFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) OVERRIDE;
+
// Called when this prerendered WebContents has just been swapped in.
void PrerenderSwappedIn();
@@ -50,6 +70,10 @@ class PrerenderTabHelper
explicit PrerenderTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<PrerenderTabHelper>;
+ void RecordEvent(Event event) const;
+ void RecordEventIfLoggedInURL(Event event, const GURL& url);
+ void RecordEventIfLoggedInURLResult(Event event, scoped_ptr<bool> is_present,
+ scoped_ptr<bool> lookup_succeeded);
// Helper class to compute pixel-based stats on the paint progress
// between when a prerendered page is swapped in and when the onload event
// fires.
@@ -59,6 +83,10 @@ class PrerenderTabHelper
// Retrieves the PrerenderManager, or NULL, if none was found.
PrerenderManager* MaybeGetPrerenderManager() const;
+ // Retrieves the LoggedInPredictorTable, or NULL, if none was found.
+ scoped_refptr<predictors::LoggedInPredictorTable>
+ MaybeGetLoggedInTable() const;
+
// Returns whether the WebContents being observed is currently prerendering.
bool IsPrerendering();
@@ -77,6 +105,8 @@ class PrerenderTabHelper
// Current URL being loaded.
GURL url_;
+ base::WeakPtrFactory<PrerenderTabHelper> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper);
};