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

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

Issue 2603663002: Make IME extensions decide when to show the keyboard. (Closed)
Patch Set: Addressed comments. Created 3 years, 11 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 | « ash/common/system/chromeos/ime_menu/ime_menu_tray.cc ('k') | ui/keyboard/keyboard_controller.h » ('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 db90c650dee9c0f54c6248a54a2df3896327268d..ce9134fc70b2a1df14eebd517abdd94a801454a7 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -1214,7 +1214,13 @@ void InputMethodManagerImpl::MaybeNotifyImeMenuActivationChanged() {
}
void InputMethodManagerImpl::OverrideKeyboardUrlRef(const std::string& keyset) {
- GURL url = keyboard::GetOverrideContentUrl();
+ GURL input_view_url;
+ if (GetActiveIMEState()) {
+ input_view_url =
+ GetActiveIMEState()->GetCurrentInputMethod().input_view_url();
+ }
+ GURL url = input_view_url.is_empty() ? keyboard::GetOverrideContentUrl()
+ : input_view_url;
// If fails to find ref or tag "id" in the ref, it means the current IME is
// not system IME, and we don't support show emoji, handwriting or voice
@@ -1222,6 +1228,7 @@ void InputMethodManagerImpl::OverrideKeyboardUrlRef(const std::string& keyset) {
if (!url.has_ref())
return;
std::string overridden_ref = url.ref();
+
auto i = overridden_ref.find("id=");
if (i == std::string::npos)
return;
@@ -1229,8 +1236,7 @@ void InputMethodManagerImpl::OverrideKeyboardUrlRef(const std::string& keyset) {
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::SetOverrideContentUrl(input_view_url);
keyboard::KeyboardController* keyboard_controller =
keyboard::KeyboardController::GetInstance();
if (keyboard_controller)
@@ -1253,6 +1259,11 @@ void InputMethodManagerImpl::OverrideKeyboardUrlRef(const std::string& keyset) {
GURL::Replacements replacements;
replacements.SetRefStr(overridden_ref);
keyboard::SetOverrideContentUrl(url.ReplaceComponents(replacements));
+
+ keyboard::KeyboardController* keyboard_controller =
+ keyboard::KeyboardController::GetInstance();
+ if (keyboard_controller)
+ keyboard_controller->Reload();
}
bool InputMethodManagerImpl::IsEmojiHandwritingVoiceOnImeMenuEnabled() {
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_menu_tray.cc ('k') | ui/keyboard/keyboard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698