Chromium Code Reviews| 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..6b44aeda754d8df18d79bc1963c8d85bba3f5bb0 |
| --- /dev/null |
| +++ b/ui/keyboard/keyboard_ui_handler.h |
| @@ -0,0 +1,44 @@ |
| +// 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 nop handler, which will log events but be unable to deliver |
| + // them. |
| + KeyboardUIHandler(); |
|
sadrul
2013/04/17 19:04:35
Is having this useful?
bryeung
2013/04/17 19:31:46
Good point: might as well pass NULL below. Remove
|
| + |
| + // Construct a handler that will deliver events to |root_window|. |
| + 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_ |