This source file includes following definitions.
- RegisterMessages
- OnUserAction
#include "chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h"
#include "base/bind.h"
#include "base/metrics/user_metrics.h"
#include "base/values.h"
#include "content/public/browser/web_ui.h"
UserActionsUIHandler::UserActionsUIHandler()
: action_callback_(base::Bind(&UserActionsUIHandler::OnUserAction,
base::Unretained(this))) {
base::AddActionCallback(action_callback_);
}
UserActionsUIHandler::~UserActionsUIHandler() {
base::RemoveActionCallback(action_callback_);
}
void UserActionsUIHandler::RegisterMessages() {}
void UserActionsUIHandler::OnUserAction(const std::string& action) {
base::StringValue user_action_name(action);
web_ui()->CallJavascriptFunction("userActions.observeUserAction",
user_action_name);
}