summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authormazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-23 19:29:12 +0000
committermazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-23 19:29:12 +0000
commitbcde7487be7f8736790e7ef758ec23703ed3a174 (patch)
tree61bafddfb5d2f2a40930de2e5065e3842f400e73 /chrome/browser/extensions
parentba693e5adbcd23d44c3e47a980e3093ab79432d3 (diff)
downloadchromium_src-bcde7487be7f8736790e7ef758ec23703ed3a174.zip
chromium_src-bcde7487be7f8736790e7ef758ec23703ed3a174.tar.gz
chromium_src-bcde7487be7f8736790e7ef758ec23703ed3a174.tar.bz2
Add hideKeyboard API to chrome.experimental.input.
And use the API in the keyboard. BUG=chromium:76413 TEST=manually on chromebook Review URL: http://codereview.chromium.org/7033033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86322 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc4
-rw-r--r--chrome/browser/extensions/extension_input_api.cc14
-rw-r--r--chrome/browser/extensions/extension_input_api.h8
3 files changed, 26 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index a64d6a1..cf6f619 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -274,6 +274,10 @@ void FactoryRegistry::ResetFunctions() {
RegisterFunction<SendKeyboardEventInputFunction>();
#endif
+#if defined(TOUCH_UI)
+ RegisterFunction<HideKeyboardFunction>();
+#endif
+
#if defined(OS_CHROMEOS) && defined(TOUCH_UI)
// IME
RegisterFunction<CandidateClickedInputUiFunction>();
diff --git a/chrome/browser/extensions/extension_input_api.cc b/chrome/browser/extensions/extension_input_api.cc
index 82df0db..53d013b 100644
--- a/chrome/browser/extensions/extension_input_api.cc
+++ b/chrome/browser/extensions/extension_input_api.cc
@@ -16,6 +16,10 @@
#include "views/ime/input_method.h"
#include "views/widget/widget.h"
+#if defined(TOUCH_UI)
+#include "content/common/notification_service.h"
+#endif
+
#if defined(OS_CHROMEOS) && defined(TOUCH_UI)
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/input_method_library.h"
@@ -125,6 +129,16 @@ bool SendKeyboardEventInputFunction::RunImpl() {
return true;
}
+#if defined(TOUCH_UI)
+bool HideKeyboardFunction::RunImpl() {
+ NotificationService::current()->Notify(
+ NotificationType::HIDE_KEYBOARD_INVOKED,
+ Source<HideKeyboardFunction>(this),
+ NotificationService::NoDetails());
+ return true;
+}
+#endif
+
#if defined(OS_CHROMEOS) && defined(TOUCH_UI)
// TODO(yusukes): This part should be moved to extension_input_api_chromeos.cc.
bool SendHandwritingStrokeFunction::RunImpl() {
diff --git a/chrome/browser/extensions/extension_input_api.h b/chrome/browser/extensions/extension_input_api.h
index 2bf7f8f..b2f80e4 100644
--- a/chrome/browser/extensions/extension_input_api.h
+++ b/chrome/browser/extensions/extension_input_api.h
@@ -33,6 +33,14 @@ class SendKeyboardEventInputFunction : public InputFunction {
views::Widget* GetTopLevelWidget();
};
+#if defined(TOUCH_UI)
+class HideKeyboardFunction : public AsyncExtensionFunction {
+ public:
+ virtual bool RunImpl();
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.input.hideKeyboard");
+};
+#endif
+
#if defined(OS_CHROMEOS) && defined(TOUCH_UI)
// Note that this experimental APIs are currently only available for
// TOUCH_UI version of Chrome OS. Please also note that the version of Chrome