#ifndef CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDLER_H_
#include <string>
#include "base/callback_list.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/translate/translate_manager.h"
#include "components/translate/core/browser/translate_language_list.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "content/public/common/webplugininfo.h"
struct LanguageDetectionDetails;
struct TranslateErrorDetails;
struct TranslateEventDetails;
namespace base {
class DictionaryValue;
class ListValue;
class Value;
}
namespace content {
class NotificationDetails;
class NotificationSource;
}
class TranslateInternalsHandler : public content::WebUIMessageHandler,
public content::NotificationObserver {
public:
TranslateInternalsHandler();
virtual ~TranslateInternalsHandler();
virtual void RegisterMessages() OVERRIDE;
private:
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
void OnTranslateError(const TranslateErrorDetails& details);
virtual void OnTranslateEvent(const TranslateEventDetails& details);
void OnRemovePrefItem(const base::ListValue* args);
void OnRequestInfo(const base::ListValue* args);
void SendMessageToJs(const std::string& message, const base::Value& value);
void SendPrefsToJs();
void SendSupportedLanguagesToJs();
scoped_ptr<TranslateLanguageList::EventCallbackList::Subscription>
event_subscription_;
scoped_ptr<TranslateManager::TranslateErrorCallbackList::Subscription>
error_subscription_;
content::NotificationRegistrar notification_registrar_;
DISALLOW_COPY_AND_ASSIGN(TranslateInternalsHandler);
};
#endif