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

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

Issue 2806613002: Check IME state in ImeController (Closed)
Patch Set: Change according to comments 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..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);
}
« 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