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..d252e36820c0085a924a10cfd8372653fd391176 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()) { |
+ 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()) { |
+ LOG(WARNING) << "Cannot switch input methods as they are not " |
+ "initialized yet."; |
+ return false; |
+ } |
return manager->GetActiveIMEState()->CanSwitchInputMethod(accelerator); |
} |