blob: 622491c7293e6087c0dd511f7bfdc98b290c586d [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_
#define CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_
#include "base/macros.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
namespace prerender {
class PrerenderManager;
// Notifies the PrerenderManager with the events happening in the prerendered
// WebContents.
class PrerenderTabHelper
: public content::WebContentsObserver,
public content::WebContentsUserData<PrerenderTabHelper> {
public:
~PrerenderTabHelper() override;
PrerenderTabHelper(const PrerenderTabHelper&) = delete;
PrerenderTabHelper& operator=(const PrerenderTabHelper&) = delete;
// content::WebContentsObserver implementation.
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
private:
explicit PrerenderTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<PrerenderTabHelper>;
WEB_CONTENTS_USER_DATA_KEY_DECL();
};
} // namespace prerender
#endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_