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

Unified Diff: ui/keyboard/keyboard_ui_handler.h

Issue 14161009: WebUIHandler for chrome://keyboard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 7 years, 8 months 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: ui/keyboard/keyboard_ui_handler.h
diff --git a/ui/keyboard/keyboard_ui_handler.h b/ui/keyboard/keyboard_ui_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..1f7e26e233db4f19d05e8b31d533fc8feb506e23
--- /dev/null
+++ b/ui/keyboard/keyboard_ui_handler.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2013 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.
+
+#ifndef UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_
+#define UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "content/public/browser/web_ui_message_handler.h"
+
+namespace aura {
+class RootWindow;
+}
+
+namespace keyboard {
+
+// The WebUI handler for chrome://keyboard.
+class KeyboardUIHandler : public content::WebUIMessageHandler {
+ public:
+ // Construct a handler that will deliver events to |root_window|. If
+ // |root_window| is null, the events will be logged and then ignored.
+ explicit KeyboardUIHandler(aura::RootWindow* root_window);
+
+ virtual ~KeyboardUIHandler();
+
+ // |content::WebUIMessageHandler| implementation:
+ virtual void RegisterMessages() OVERRIDE;
+
+ private:
+ // Callback for the "sendKeyEvent" message.
+ void HandleSendKeyEventMessage(const base::ListValue* args);
+
+ aura::RootWindow* root_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(KeyboardUIHandler);
+};
+
+} // namespace keyboard
+
+#endif // UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698