OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 5 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
6 | 6 |
7 #include "chromeos/ime/input_method_manager.h" | 7 #include "chromeos/ime/input_method_manager.h" |
8 #include "ui/base/accelerators/accelerator.h" | 8 #include "ui/base/accelerators/accelerator.h" |
9 | 9 |
10 bool ImeController::HandleNextIme() { | 10 bool ImeController::HandleNextIme() { |
11 chromeos::input_method::InputMethodManager* manager = | 11 chromeos::input_method::InputMethodManager* manager = |
12 chromeos::input_method::InputMethodManager::Get(); | 12 chromeos::input_method::InputMethodManager::Get(); |
13 return manager->SwitchToNextInputMethod(); | 13 manager->SwitchToNextInputMethod(); |
14 return false; | |
14 } | 15 } |
15 | 16 |
16 bool ImeController::HandlePreviousIme(const ui::Accelerator& accelerator) { | 17 bool ImeController::HandlePreviousIme(const ui::Accelerator& accelerator) { |
17 chromeos::input_method::InputMethodManager* manager = | 18 chromeos::input_method::InputMethodManager* manager = |
18 chromeos::input_method::InputMethodManager::Get(); | 19 chromeos::input_method::InputMethodManager::Get(); |
19 return manager->SwitchToPreviousInputMethod(accelerator); | 20 return manager->SwitchToPreviousInputMethod(accelerator); |
Shu Chen
2014/06/24 00:48:49
Why not do the same as HandleNextIme()?
Seigo Nonaka
2014/06/24 04:35:01
HandlePreviousIme is bound to "Ctrl-Space".
If we
| |
20 } | 21 } |
21 | 22 |
22 bool ImeController::HandleSwitchIme(const ui::Accelerator& accelerator) { | 23 bool ImeController::HandleSwitchIme(const ui::Accelerator& accelerator) { |
23 chromeos::input_method::InputMethodManager* manager = | 24 chromeos::input_method::InputMethodManager* manager = |
24 chromeos::input_method::InputMethodManager::Get(); | 25 chromeos::input_method::InputMethodManager::Get(); |
25 return manager->SwitchInputMethod(accelerator); | 26 return manager->SwitchInputMethod(accelerator); |
26 } | 27 } |
27 | 28 |
28 ui::Accelerator ImeController::RemapAccelerator( | 29 ui::Accelerator ImeController::RemapAccelerator( |
29 const ui::Accelerator& accelerator) { | 30 const ui::Accelerator& accelerator) { |
(...skipping 17 matching lines...) Expand all Loading... | |
47 } | 48 } |
48 | 49 |
49 bool ImeController::UsingFrenchInputMethod() const { | 50 bool ImeController::UsingFrenchInputMethod() const { |
50 chromeos::input_method::InputMethodManager* manager = | 51 chromeos::input_method::InputMethodManager* manager = |
51 chromeos::input_method::InputMethodManager::Get(); | 52 chromeos::input_method::InputMethodManager::Get(); |
52 const chromeos::input_method::InputMethodDescriptor& descriptor = | 53 const chromeos::input_method::InputMethodDescriptor& descriptor = |
53 manager->GetCurrentInputMethod(); | 54 manager->GetCurrentInputMethod(); |
54 const std::string& layout = descriptor.id(); | 55 const std::string& layout = descriptor.id(); |
55 return (layout == "xkb:fr::fra" || layout == "xkb:be::fra"); | 56 return (layout == "xkb:fr::fra" || layout == "xkb:be::fra"); |
56 } | 57 } |
OLD | NEW |