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

Unified Diff: chrome/browser/extensions/extension_input_api.cc

Issue 7058046: Adjust virtual keyboard size base on input method candidates. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase on trunk Created 9 years, 6 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
« no previous file with comments | « chrome/browser/extensions/extension_input_api.h ('k') | chrome/browser/resources/keyboard/ime.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_input_api.cc
diff --git a/chrome/browser/extensions/extension_input_api.cc b/chrome/browser/extensions/extension_input_api.cc
index 0b2db172a4202381009061c515a2eee0f77a3ebc..6ac4ccbaea60242607199232075a9322aa85fb40 100644
--- a/chrome/browser/extensions/extension_input_api.cc
+++ b/chrome/browser/extensions/extension_input_api.cc
@@ -45,6 +45,7 @@ const char kUnknownOrUnsupportedKeyIdentiferError[] = "Unknown or unsupported "
const char kUnsupportedModifier[] = "Unsupported modifier.";
const char kNoValidRecipientError[] = "No valid recipient for event.";
const char kKeyEventUnprocessedError[] = "Event was not handled.";
+const char kInvalidHeight[] = "Invalid height.";
#if defined(OS_CHROMEOS) && defined(TOUCH_UI)
const char kCrosLibraryNotLoadedError[] = "Cros shared library not loaded.";
#endif
@@ -144,6 +145,25 @@ bool HideKeyboardFunction::RunImpl() {
NotificationService::NoDetails());
return true;
}
+
+bool SetKeyboardHeightFunction::RunImpl() {
+ int height = 0;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &height));
+
+ if (height < 0) {
+ error_ = kInvalidHeight;
+ return false;
+ }
+
+ // TODO(penghuang) Check the height is not greater than height of browser view
+ // and set the height of virtual keyboard directly instead of using
+ // notification.
+ NotificationService::current()->Notify(
+ NotificationType::SET_KEYBOARD_HEIGHT_INVOKED,
+ Source<SetKeyboardHeightFunction>(this),
+ Details<int>(&height));
+ return true;
+}
#endif
#if defined(OS_CHROMEOS) && defined(TOUCH_UI)
« no previous file with comments | « chrome/browser/extensions/extension_input_api.h ('k') | chrome/browser/resources/keyboard/ime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698