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

Unified Diff: chrome/browser/ui/ash/ime_controller_chromeos.cc

Issue 2806613002: Check IME state in ImeController (Closed)
Patch Set: Check IME state Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/ime_controller_chromeos.cc
diff --git a/chrome/browser/ui/ash/ime_controller_chromeos.cc b/chrome/browser/ui/ash/ime_controller_chromeos.cc
index f9637bb2a8ccc776568eab7734037e2508043968..aff89a02a069e75a1341f8ca11eebbdc9b18a597 100644
--- a/chrome/browser/ui/ash/ime_controller_chromeos.cc
+++ b/chrome/browser/ui/ash/ime_controller_chromeos.cc
@@ -10,6 +10,12 @@
bool ImeController::CanCycleIme() {
chromeos::input_method::InputMethodManager* manager =
chromeos::input_method::InputMethodManager::Get();
+ DCHECK(manager);
+ if (manager->GetActiveIMEState() == NULL) {
xiyuan 2017/04/27 03:16:41 nit: NULL -> nullptr of if (!manager->GetActiveIM
Wenzhao (Colin) Zang 2017/04/27 03:31:55 Done.
+ LOG(WARNING) << "Cannot cycle through input methods as they are not "
+ "initialized yet.";
+ return false;
+ }
return manager->GetActiveIMEState()->CanCycleInputMethod();
}
@@ -28,6 +34,12 @@ void ImeController::HandlePreviousIme() {
bool ImeController::CanSwitchIme(const ui::Accelerator& accelerator) {
chromeos::input_method::InputMethodManager* manager =
chromeos::input_method::InputMethodManager::Get();
+ DCHECK(manager);
+ if (manager->GetActiveIMEState() == NULL) {
xiyuan 2017/04/27 03:16:41 nit: ditto
Wenzhao (Colin) Zang 2017/04/27 03:31:55 Done.
+ LOG(WARNING) << "Cannot switch input methods as they are not "
+ "initialized yet.";
+ return false;
+ }
return manager->GetActiveIMEState()->CanSwitchInputMethod(accelerator);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698