Chromium Code Reviews| Index: chrome/browser/ui/views/ash/ime_controller_chromeos.cc |
| diff --git a/chrome/browser/ui/views/ash/ime_controller_chromeos.cc b/chrome/browser/ui/views/ash/ime_controller_chromeos.cc |
| index 1934357e90140bc62cc7e8ea681e6ab6cc68b498..352851d8f6ce7dc7f40d2f5bb23bc05d73b801a8 100644 |
| --- a/chrome/browser/ui/views/ash/ime_controller_chromeos.cc |
| +++ b/chrome/browser/ui/views/ash/ime_controller_chromeos.cc |
| @@ -4,8 +4,13 @@ |
| #include "chrome/browser/ui/views/ash/ime_controller_chromeos.h" |
| +#include "base/string_util.h" |
| #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| +#include "chrome/browser/browser_process.h" |
| +#include "chrome/browser/prefs/pref_service.h" |
| +#include "chrome/browser/chromeos/language_preferences.h" |
| + |
| bool ImeController::HandleNextIme() { |
| chromeos::input_method::InputMethodManager* manager = |
| chromeos::input_method::InputMethodManager::GetInstance(); |
| @@ -23,3 +28,18 @@ bool ImeController::HandleSwitchIme(const ui::Accelerator& accelerator) { |
| chromeos::input_method::InputMethodManager::GetInstance(); |
| return manager->SwitchInputMethod(accelerator); |
| } |
| + |
| +bool ImeController::IsFrenchKeyboard() { |
| + // First check the settings. |
| + std::string layout = g_browser_process->local_state()->GetString( |
| + chromeos::language_prefs::kPreferredKeyboardLayout); |
|
Yusuke Sato
2012/05/29 08:29:11
please remove line 33-36. the pref is for login sc
Mr4D (OOO till 08-26)
2012/05/29 14:59:25
I don't think so. When a user overwrites the keybo
Yusuke Sato
2012/05/29 16:13:38
In short: the return value of GetCurrentInputMetho
Mr4D (OOO till 08-26)
2012/05/29 21:40:36
This is now really weird: I have tried this before
|
| + if (layout == "") { |
| + // If it is unset we check the hardware. |
| + chromeos::input_method::InputMethodManager* manager = |
| + chromeos::input_method::InputMethodManager::GetInstance(); |
| + const chromeos::input_method::InputMethodDescriptor& descriptor = |
| + manager->GetCurrentInputMethod(); |
| + layout = descriptor.id(); |
| + } |
| + return EndsWith(layout, ":fra", false); |
|
Yusuke Sato
2012/05/29 08:29:11
This matches the following 4 layouts: xkb:fr::fra,
Mr4D (OOO till 08-26)
2012/05/29 14:59:25
Done. I had no idea that there are even different
|
| +} |