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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 2436723002: Override keyset with the IME layout info. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index fb5e5f45dcfbb284a597162f5e6d29b29086ce9a..99e2bec44aa19df9c16b0bee06247029f7cf7929 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -1223,27 +1223,32 @@ void InputMethodManagerImpl::OverrideKeyboardUrlRef(const std::string& keyset) {
if (!url.has_ref())
return;
std::string overridden_ref = url.ref();
- auto i = overridden_ref.find("id");
+ auto i = overridden_ref.find("id=");
if (i == std::string::npos)
return;
if (keyset.empty()) {
+ // Resets the url as the input method default url and notify the hash
+ // changed to VK.
keyboard::SetOverrideContentUrl(
GetActiveIMEState()->GetCurrentInputMethod().input_view_url());
+ keyboard::KeyboardController* keyboard_controller =
+ keyboard::KeyboardController::GetInstance();
+ if (keyboard_controller)
+ keyboard_controller->Reload();
return;
}
// For system IME extension, the input view url is overridden as:
// chrome-extension://${extension_id}/inputview.html#id=us.compact.qwerty
// &language=en-US&passwordLayout=us.compact.qwerty&name=keyboard_us
- // Fow emoji and handwriting input, we replace the id=${keyset} part with
- // desired keyset like: id=emoji; For voice, we append ".voice" to the end of
- // id like: id=${keyset}.voice.
+ // Fow emoji, handwriting and voice input, we append the keyset to the end of
+ // id like: id=${keyset}.emoji/hwt/voice.
auto j = overridden_ref.find("&", i + 1);
- if (keyset == "voice") {
- overridden_ref.replace(j, 0, "." + keyset);
+ if (j == std::string::npos) {
+ overridden_ref += "." + keyset;
} else {
- overridden_ref.replace(i, j - i, "id=" + keyset);
+ overridden_ref.replace(j, 0, "." + keyset);
}
GURL::Replacements replacements;
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698