| 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() |
| 11 : add_observer_count_(0), | 11 : add_observer_count_(0), |
| 12 remove_observer_count_(0), | 12 remove_observer_count_(0), |
| 13 util_(&delegate_, whitelist_.GetSupportedInputMethods()) { | 13 util_(&delegate_, whitelist_.GetSupportedInputMethods()) { |
| 14 active_input_method_ids_.push_back("xkb:us::eng"); |
| 14 } | 15 } |
| 15 | 16 |
| 16 MockInputMethodManager::~MockInputMethodManager() { | 17 MockInputMethodManager::~MockInputMethodManager() { |
| 17 } | 18 } |
| 18 | 19 |
| 19 void MockInputMethodManager::AddObserver( | 20 void MockInputMethodManager::AddObserver( |
| 20 InputMethodManager::Observer* observer) { | 21 InputMethodManager::Observer* observer) { |
| 21 ++add_observer_count_; | 22 ++add_observer_count_; |
| 22 } | 23 } |
| 23 | 24 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 } | 44 } |
| 44 | 45 |
| 45 scoped_ptr<InputMethodDescriptors> | 46 scoped_ptr<InputMethodDescriptors> |
| 46 MockInputMethodManager::GetActiveInputMethods() const { | 47 MockInputMethodManager::GetActiveInputMethods() const { |
| 47 scoped_ptr<InputMethodDescriptors> result(new InputMethodDescriptors); | 48 scoped_ptr<InputMethodDescriptors> result(new InputMethodDescriptors); |
| 48 result->push_back( | 49 result->push_back( |
| 49 InputMethodUtil::GetFallbackInputMethodDescriptor()); | 50 InputMethodUtil::GetFallbackInputMethodDescriptor()); |
| 50 return result.Pass(); | 51 return result.Pass(); |
| 51 } | 52 } |
| 52 | 53 |
| 54 const std::vector<std::string>& |
| 55 MockInputMethodManager::GetActiveInputMethodIds() const { |
| 56 return active_input_method_ids_; |
| 57 } |
| 58 |
| 53 size_t MockInputMethodManager::GetNumActiveInputMethods() const { | 59 size_t MockInputMethodManager::GetNumActiveInputMethods() const { |
| 54 return 1; | 60 return 1; |
| 55 } | 61 } |
| 56 | 62 |
| 57 void MockInputMethodManager::EnableLayouts(const std::string& language_code, | 63 void MockInputMethodManager::EnableLayouts(const std::string& language_code, |
| 58 const std::string& initial_layout) { | 64 const std::string& initial_layout) { |
| 59 } | 65 } |
| 60 | 66 |
| 61 bool MockInputMethodManager::EnableInputMethods( | 67 bool MockInputMethodManager::EnableInputMethods( |
| 62 const std::vector<std::string>& new_active_input_method_ids) { | 68 const std::vector<std::string>& new_active_input_method_ids) { |
| 63 return true; | 69 return true; |
| 64 } | 70 } |
| 65 | 71 |
| 72 bool MockInputMethodManager::EnableInputMethod( |
| 73 const std::string& new_active_input_method_id) { |
| 74 return true; |
| 75 } |
| 76 |
| 66 bool MockInputMethodManager::MigrateOldInputMethods( | 77 bool MockInputMethodManager::MigrateOldInputMethods( |
| 67 std::vector<std::string>* input_method_ids) { | 78 std::vector<std::string>* input_method_ids) { |
| 68 return false; | 79 return false; |
| 69 } | 80 } |
| 70 | 81 |
| 71 bool MockInputMethodManager::MigrateKoreanKeyboard( | 82 bool MockInputMethodManager::MigrateKoreanKeyboard( |
| 72 const std::string& keyboard_id, | 83 const std::string& keyboard_id, |
| 73 std::vector<std::string>* input_method_ids) { | 84 std::vector<std::string>* input_method_ids) { |
| 74 return false; | 85 return false; |
| 75 } | 86 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 166 |
| 156 void MockInputMethodManager::set_application_locale(const std::string& value) { | 167 void MockInputMethodManager::set_application_locale(const std::string& value) { |
| 157 delegate_.set_active_locale(value); | 168 delegate_.set_active_locale(value); |
| 158 } | 169 } |
| 159 | 170 |
| 160 void MockInputMethodManager::set_hardware_keyboard_layout( | 171 void MockInputMethodManager::set_hardware_keyboard_layout( |
| 161 const std::string& value) { | 172 const std::string& value) { |
| 162 delegate_.set_hardware_keyboard_layout(value); | 173 delegate_.set_hardware_keyboard_layout(value); |
| 163 } | 174 } |
| 164 | 175 |
| 176 bool MockInputMethodManager::IsFullLatinKeyboard( |
| 177 const std::string& layout) const { |
| 178 return true; |
| 179 } |
| 165 } // namespace input_method | 180 } // namespace input_method |
| 166 } // namespace chromeos | 181 } // namespace chromeos |
| OLD | NEW |