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

Unified Diff: chrome/browser/extensions/api/input/input.cc

Issue 20526005: Implement virtual keyboard hiding. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase yet again Created 7 years, 3 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: chrome/browser/extensions/api/input/input.cc
diff --git a/chrome/browser/extensions/api/input/input.cc b/chrome/browser/extensions/api/input/input.cc
index 4fd7c53582150026f4e38debf903e2290e16fc33..b0e57fd4672487f6a1ae468d6bba487180065839 100644
--- a/chrome/browser/extensions/api/input/input.cc
+++ b/chrome/browser/extensions/api/input/input.cc
@@ -4,11 +4,13 @@
#include "chrome/browser/extensions/api/input/input.h"
+#include "ash/root_window_controller.h"
#include "base/lazy_instance.h"
#include "base/strings/string16.h"
#include "chrome/browser/extensions/extension_function_registry.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/events/event.h"
+#include "ui/keyboard/keyboard_controller.h"
#if defined(USE_ASH)
#include "ash/shell.h"
@@ -76,7 +78,19 @@ bool SendKeyEventFunction::RunImpl() {
key_code,
shift_modifier,
ash::Shell::GetPrimaryRootWindow());
+#endif
+ error_ = kNotYetImplementedError;
+ return false;
+}
+
+bool HideKeyboardFunction::RunImpl() {
+#if defined(USE_ASH)
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ ash::Shell::GetPrimaryRootWindowController()->keyboard_controller()->
+ HideKeyboard();
+ return true;
#endif
error_ = kNotYetImplementedError;
return false;
@@ -88,6 +102,7 @@ InputAPI::InputAPI(Profile* profile) {
registry->RegisterFunction<InsertTextFunction>();
registry->RegisterFunction<MoveCursorFunction>();
registry->RegisterFunction<SendKeyEventFunction>();
+ registry->RegisterFunction<HideKeyboardFunction>();
}
InputAPI::~InputAPI() {
« no previous file with comments | « chrome/browser/extensions/api/input/input.h ('k') | chrome/browser/extensions/extension_function_histogram_value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698