Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3738)

Unified Diff: chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc

Issue 11415063: Adds about:user-actions page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove extraneous comment Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc
diff --git a/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc b/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fa5f956bc2272cbd8cfc7e5119ae51f62535d9ee
--- /dev/null
+++ b/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc
@@ -0,0 +1,35 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h"
+
+#include "base/logging.h"
+#include "base/values.h"
+#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_source.h"
+#include "content/public/browser/notification_types.h"
+#include "content/public/browser/web_ui.h"
+
+UserActionsUIHandler::UserActionsUIHandler() : NotificationObserver() {
+ registrar_.Add(this,
+ content::NOTIFICATION_USER_ACTION,
+ content::NotificationService::AllSources());
+}
+
+UserActionsUIHandler::~UserActionsUIHandler() {
+}
+
+void UserActionsUIHandler::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
+ DCHECK_EQ(type, content::NOTIFICATION_USER_ACTION);
+ base::StringValue user_action_name(
+ *content::Details<const char*>(details).ptr());
+ web_ui()->CallJavascriptFunction("userActions.observeUserAction",
+ user_action_name);
+}
+
+void UserActionsUIHandler::RegisterMessages() {}

Powered by Google App Engine
This is Rietveld 408576698