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

Unified Diff: chrome/browser/extensions/api/input/input.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: 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 f0eecbeb303d338e25d6c34953cc53bc1d89dcd3..3c2a6a34d5b12e601d1ce615bc3dbf3a3986dfae 100644
--- a/chrome/browser/extensions/api/input/input.cc
+++ b/chrome/browser/extensions/api/input/input.cc
@@ -15,6 +15,7 @@
#if defined(USE_ASH)
#include "ash/shell.h"
#include "ui/aura/root_window.h"
+#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_util.h"
#endif
@@ -45,9 +46,26 @@ bool SendKeyboardEventInputFunction::RunImpl() {
return false;
}
+bool SetKeyboardVisibilityFunction::RunImpl() {
+#if defined(USE_ASH)
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ bool visible;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &visible));
+
+ ash::Shell::GetKeyboardController()->SetKeyboardVisibility(visible);
+
+ return true;
+#endif
+ error_ = kNotYetImplementedError;
+ return false;
+}
+
+
InputAPI::InputAPI(Profile* profile) {
ExtensionFunctionRegistry* registry =
ExtensionFunctionRegistry::GetInstance();
+ registry->RegisterFunction<SetKeyboardVisibilityFunction>();
registry->RegisterFunction<SendKeyboardEventInputFunction>();
}

Powered by Google App Engine
This is Rietveld 408576698