OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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 #ifndef UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_ |
| 6 #define UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "content/public/browser/web_ui_message_handler.h" |
| 11 |
| 12 namespace aura { |
| 13 class RootWindow; |
| 14 } |
| 15 |
| 16 namespace keyboard { |
| 17 |
| 18 // The WebUI handler for chrome://keyboard. |
| 19 class KeyboardUIHandler : public content::WebUIMessageHandler { |
| 20 public: |
| 21 // Construct a handler that will deliver events to |root_window|. If |
| 22 // |root_window| is null, the events will be logged and then ignored. |
| 23 explicit KeyboardUIHandler(aura::RootWindow* root_window); |
| 24 |
| 25 virtual ~KeyboardUIHandler(); |
| 26 |
| 27 // |content::WebUIMessageHandler| implementation: |
| 28 virtual void RegisterMessages() OVERRIDE; |
| 29 |
| 30 private: |
| 31 // Callback for the "sendKeyEvent" message. |
| 32 void HandleSendKeyEventMessage(const base::ListValue* args); |
| 33 |
| 34 aura::RootWindow* root_window_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(KeyboardUIHandler); |
| 37 }; |
| 38 |
| 39 } // namespace keyboard |
| 40 |
| 41 #endif // UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_ |
OLD | NEW |