Chromium Code Reviews| Index: ui/keyboard/keyboard_ui_handler.cc |
| diff --git a/ui/keyboard/keyboard_ui_handler.cc b/ui/keyboard/keyboard_ui_handler.cc |
| index 291f3a05f4cee02bf4feb7bbd6b99dd89e0b16dd..2fd1fa13595a34fa1e38a7e5296f6d044f44ced9 100644 |
| --- a/ui/keyboard/keyboard_ui_handler.cc |
| +++ b/ui/keyboard/keyboard_ui_handler.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/bind.h" |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/values.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_view.h" |
| #include "content/public/browser/web_ui.h" |
| @@ -26,11 +27,25 @@ KeyboardUIHandler::~KeyboardUIHandler() { |
| void KeyboardUIHandler::RegisterMessages() { |
| web_ui()->RegisterMessageCallback( |
| + "setKeyboardVisibility", |
|
sadrul
2013/05/14 06:23:19
Will this be ever used to show the keyboard? i.e.
|
| + base::Bind(&KeyboardUIHandler::HandleSendKeyEventMessage, |
| + base::Unretained(this))); |
| + web_ui()->RegisterMessageCallback( |
| "sendKeyEvent", |
| base::Bind(&KeyboardUIHandler::HandleSendKeyEventMessage, |
| base::Unretained(this))); |
| } |
| +void KeyboardUIHandler::HandleSetKeyboardVisibility( |
| + const base::ListValue* args) { |
| + bool visible; |
| + if (!args->GetBoolean(0, &visible)) { |
| + LOG(ERROR) << "setKeyboardVisibility failed: argument parsing error"; |
| + return; |
| + } |
| + // TODO(sadrul): get the KeyboardController without using the Shell |
|
sadrul
2013/05/14 06:23:19
I can't think of a good way of doing this. One opt
|
| +} |
| + |
| void KeyboardUIHandler::HandleSendKeyEventMessage(const base::ListValue* args) { |
| std::string error; |
| scoped_ptr<ui::KeyEvent> event(keyboard::KeyEventFromArgs(args, &error)); |