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

Unified Diff: ui/keyboard/keyboard_ui_handler.cc

Issue 14674004: DRAFT: Add setKeyboardVisibility API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.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));

Powered by Google App Engine
This is Rietveld 408576698