#ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_
#define COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_
#include "components/translate/core/browser/translate_driver.h"
#include "components/translate/core/browser/language_state.h"
namespace content {
struct LoadCommittedDetails;
class NavigationController;
class WebContents;
}
class ContentTranslateDriver : public TranslateDriver {
public:
class Observer {
public:
virtual void OnIsPageTranslatedChanged(content::WebContents* source) = 0;
virtual void OnTranslateEnabledChanged(content::WebContents* source) = 0;
protected:
virtual ~Observer() {}
};
ContentTranslateDriver(content::NavigationController* nav_controller);
virtual ~ContentTranslateDriver();
void set_observer(Observer* observer) { observer_ = observer; }
void DidNavigate(const content::LoadCommittedDetails& details);
virtual void OnIsPageTranslatedChanged() OVERRIDE;
virtual void OnTranslateEnabledChanged() OVERRIDE;
virtual bool IsLinkNavigation() OVERRIDE;
virtual LanguageState& GetLanguageState() OVERRIDE;
private:
content::NavigationController* navigation_controller_;
LanguageState language_state_;
Observer* observer_;
DISALLOW_COPY_AND_ASSIGN(ContentTranslateDriver);
};
#endif