1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h"
8 #include "base/metrics/user_metrics.h"
9 #include "base/values.h"
10 #include "content/public/browser/web_ui.h"
12 UserActionsUIHandler::UserActionsUIHandler()
13 : action_callback_(base::Bind(&UserActionsUIHandler::OnUserAction
,
14 base::Unretained(this))) {
15 base::AddActionCallback(action_callback_
);
18 UserActionsUIHandler::~UserActionsUIHandler() {
19 base::RemoveActionCallback(action_callback_
);
22 void UserActionsUIHandler::RegisterMessages() {}
24 void UserActionsUIHandler::OnUserAction(const std::string
& action
) {
25 base::StringValue
user_action_name(action
);
26 web_ui()->CallJavascriptFunction("userActions.observeUserAction",