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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h"
6
7 #include "base/logging.h"
8 #include "base/values.h"
9 #include "content/public/browser/notification_details.h"
10 #include "content/public/browser/notification_service.h"
11 #include "content/public/browser/notification_source.h"
12 #include "content/public/browser/notification_types.h"
13 #include "content/public/browser/web_ui.h"
14
15 UserActionsUIHandler::UserActionsUIHandler() : NotificationObserver() {
16 registrar_.Add(this,
17 content::NOTIFICATION_USER_ACTION,
18 content::NotificationService::AllSources());
19 }
20
21 UserActionsUIHandler::~UserActionsUIHandler() {
22 }
23
24 void UserActionsUIHandler::Observe(
25 int type,
26 const content::NotificationSource& source,
27 const content::NotificationDetails& details) {
28 DCHECK_EQ(type, content::NOTIFICATION_USER_ACTION);
29 base::StringValue user_action_name(
30 *content::Details<const char*>(details).ptr());
31 web_ui()->CallJavascriptFunction("userActions.observeUserAction",
32 user_action_name);
33 }
34
35 void UserActionsUIHandler::RegisterMessages() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698