#ifndef CHROME_BROWSER_UI_SEARCH_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_
#define CHROME_BROWSER_UI_SEARCH_ENGINES_SEARCH_ENGINE_TAB_HELPER_H_
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_notification_details.h"
#include "chrome/common/search_provider.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
class SearchEngineTabHelperDelegate;
class SearchEngineTabHelper
: public content::WebContentsObserver,
public content::WebContentsUserData<SearchEngineTabHelper> {
public:
virtual ~SearchEngineTabHelper();
SearchEngineTabHelperDelegate* delegate() const { return delegate_; }
void set_delegate(SearchEngineTabHelperDelegate* d) { delegate_ = d; }
virtual void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
private:
explicit SearchEngineTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<SearchEngineTabHelper>;
void OnPageHasOSDD(int32 page_id,
const GURL& doc_url,
const search_provider::OSDDType& msg_provider_type);
void GenerateKeywordIfNecessary(
const content::FrameNavigateParams& params);
SearchEngineTabHelperDelegate* delegate_;
DISALLOW_COPY_AND_ASSIGN(SearchEngineTabHelper);
};
#endif