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

Unified Diff: chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc

Issue 1315233006: Add chrome.virtualKeyboardPrivate.setHotrodKeyboard api (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
index 3b758870627d57a375d1b940e14188be4e39a545..913e38a521a23393b7c3ae5450cb88383a1bc80c 100644
--- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
+++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
@@ -73,6 +73,7 @@ bool ChromeVirtualKeyboardDelegate::GetKeyboardConfig(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
results->SetString("layout", keyboard::GetKeyboardLayout());
results->SetBoolean("a11ymode", keyboard::GetAccessibilityKeyboardEnabled());
+ results->SetBoolean("hotrodmode", keyboard::GetHotrodKeyboardEnabled());
scoped_ptr<base::ListValue> features(new base::ListValue());
features->AppendString(GenerateFeatureFlag(
"floatingvirtualkeyboard", keyboard::IsFloatingVirtualKeyboardEnabled()));
@@ -117,6 +118,18 @@ bool ChromeVirtualKeyboardDelegate::OnKeyboardLoaded() {
return true;
}
+void ChromeVirtualKeyboardDelegate::SetHotrodKeyboard(bool enable) {
+ if (keyboard::GetHotrodKeyboardEnabled() == enable)
+ return;
+
+ keyboard::SetHotrodKeyboardEnabled(enable);
+ // This reloads virtual keyboard even if it exists. This ensures virtual
+ // keyboard gets the correct state of the hotrod keyboard through
+ // chrome.virtualKeyboardPrivate.getKeyboardConfig.
+ if (enable && keyboard::IsKeyboardEnabled())
rsadam 2015/09/08 21:48:22 Does this actually reload the keyboard? Looking th
+ ash::Shell::GetInstance()->CreateKeyboard();
+}
+
bool ChromeVirtualKeyboardDelegate::LockKeyboard(bool state) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
keyboard::KeyboardController* controller =

Powered by Google App Engine
This is Rietveld 408576698