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

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: Init Created 7 years, 5 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 b4d264fcbec26bc28dc068196428d7b505126d8a..cef26a5344d254a41a037126160cceaa775f11f8 100644
--- a/chrome/browser/extensions/api/input/input.cc
+++ b/chrome/browser/extensions/api/input/input.cc
@@ -4,12 +4,14 @@
#include "chrome/browser/extensions/api/input/input.h"
+#include "ash/root_window_controller.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.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"
@@ -38,10 +40,24 @@ bool InsertTextInputFunction::RunImpl() {
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;
+}
+
InputAPI::InputAPI(Profile* profile) {
ExtensionFunctionRegistry* registry =
ExtensionFunctionRegistry::GetInstance();
registry->RegisterFunction<InsertTextInputFunction>();
+ registry->RegisterFunction<HideKeyboardFunction>();
}
InputAPI::~InputAPI() {

Powered by Google App Engine
This is Rietveld 408576698