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.
5 #ifndef UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_
6 #define UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "content/public/browser/web_ui_message_handler.h"
14 // The WebUI handler for chrome://keyboard. Inserts text into the currently
15 // focused TextInputClient.
16 class KeyboardUIHandler : public content::WebUIMessageHandler {
19 virtual ~KeyboardUIHandler();
22 // |content::WebUIMessageHandler| implementation:
23 virtual void RegisterMessages() OVERRIDE;
25 // Callback for the "insertText" message.
26 void HandleInsertTextMessage(const base::ListValue* args);
28 // Callback for the "getInputContext" message. The first element in
29 // |args| should be an integer representing request ID.
30 void HandleGetInputContextMessage(const base::ListValue* args);
32 // Callback for the "sendKeyEvent" message. The first element in |args| is a
33 // dictionary containing an event type, the character being pressed or
34 // released, a virtual key code, and the state of the shift key.
35 void HandleSendKeyEventMessage(const base::ListValue* args);
37 // Callback for the "hideKeyboard" message.
38 void HandleHideKeyboard(const base::ListValue* args);
40 DISALLOW_COPY_AND_ASSIGN(KeyboardUIHandler);
43 } // namespace keyboard
45 #endif // UI_KEYBOARD_KEYBOARD_UI_HANDLER_H_