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/chromeos/input_method/mock_input_method_manager.h" | 5 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" |
6 | 6 |
7 namespace chromeos { | 7 namespace chromeos { |
8 namespace input_method { | 8 namespace input_method { |
9 | 9 |
10 MockInputMethodManager::MockInputMethodManager() | 10 MockInputMethodManager::MockInputMethodManager() |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 const std::vector<std::string>& | 54 const std::vector<std::string>& |
55 MockInputMethodManager::GetActiveInputMethodIds() const { | 55 MockInputMethodManager::GetActiveInputMethodIds() const { |
56 return active_input_method_ids_; | 56 return active_input_method_ids_; |
57 } | 57 } |
58 | 58 |
59 size_t MockInputMethodManager::GetNumActiveInputMethods() const { | 59 size_t MockInputMethodManager::GetNumActiveInputMethods() const { |
60 return 1; | 60 return 1; |
61 } | 61 } |
62 | 62 |
| 63 const InputMethodDescriptor* MockInputMethodManager::GetInputMethodFromId( |
| 64 const std::string& input_method_id) const { |
| 65 static const InputMethodDescriptor defaultInputMethod = |
| 66 InputMethodUtil::GetFallbackInputMethodDescriptor(); |
| 67 for (size_t i = 0; i < active_input_method_ids_.size(); i++) { |
| 68 if (input_method_id == active_input_method_ids_[i]) { |
| 69 return &defaultInputMethod; |
| 70 } |
| 71 } |
| 72 return NULL; |
| 73 } |
| 74 |
63 void MockInputMethodManager::EnableLayouts(const std::string& language_code, | 75 void MockInputMethodManager::EnableLayouts(const std::string& language_code, |
64 const std::string& initial_layout) { | 76 const std::string& initial_layout) { |
65 } | 77 } |
66 | 78 |
67 bool MockInputMethodManager::EnableInputMethods( | 79 bool MockInputMethodManager::EnableInputMethods( |
68 const std::vector<std::string>& new_active_input_method_ids) { | 80 const std::vector<std::string>& new_active_input_method_ids) { |
69 return true; | 81 return true; |
70 } | 82 } |
71 | 83 |
72 bool MockInputMethodManager::EnableInputMethod( | 84 bool MockInputMethodManager::EnableInputMethod( |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 const std::string& value) { | 172 const std::string& value) { |
161 delegate_.set_hardware_keyboard_layout(value); | 173 delegate_.set_hardware_keyboard_layout(value); |
162 } | 174 } |
163 | 175 |
164 bool MockInputMethodManager::IsLoginKeyboard( | 176 bool MockInputMethodManager::IsLoginKeyboard( |
165 const std::string& layout) const { | 177 const std::string& layout) const { |
166 return true; | 178 return true; |
167 } | 179 } |
168 } // namespace input_method | 180 } // namespace input_method |
169 } // namespace chromeos | 181 } // namespace chromeos |
OLD | NEW |