| 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 set_state_count_(0), | |
| 14 last_state_(STATE_TERMINATING), | |
| 15 util_(&delegate_, whitelist_.GetSupportedInputMethods()) { | 13 util_(&delegate_, whitelist_.GetSupportedInputMethods()) { |
| 16 } | 14 } |
| 17 | 15 |
| 18 MockInputMethodManager::~MockInputMethodManager() { | 16 MockInputMethodManager::~MockInputMethodManager() { |
| 19 } | 17 } |
| 20 | 18 |
| 21 void MockInputMethodManager::AddObserver( | 19 void MockInputMethodManager::AddObserver( |
| 22 InputMethodManager::Observer* observer) { | 20 InputMethodManager::Observer* observer) { |
| 23 ++add_observer_count_; | 21 ++add_observer_count_; |
| 24 } | 22 } |
| 25 | 23 |
| 26 void MockInputMethodManager::AddCandidateWindowObserver( | 24 void MockInputMethodManager::AddCandidateWindowObserver( |
| 27 InputMethodManager::CandidateWindowObserver* observer) { | 25 InputMethodManager::CandidateWindowObserver* observer) { |
| 28 } | 26 } |
| 29 | 27 |
| 30 void MockInputMethodManager::RemoveObserver( | 28 void MockInputMethodManager::RemoveObserver( |
| 31 InputMethodManager::Observer* observer) { | 29 InputMethodManager::Observer* observer) { |
| 32 ++remove_observer_count_; | 30 ++remove_observer_count_; |
| 33 } | 31 } |
| 34 | 32 |
| 35 void MockInputMethodManager::RemoveCandidateWindowObserver( | 33 void MockInputMethodManager::RemoveCandidateWindowObserver( |
| 36 InputMethodManager::CandidateWindowObserver* observer) { | 34 InputMethodManager::CandidateWindowObserver* observer) { |
| 37 } | 35 } |
| 38 | 36 |
| 39 void MockInputMethodManager::SetState(State new_state) { | |
| 40 ++set_state_count_; | |
| 41 last_state_ = new_state; | |
| 42 } | |
| 43 | |
| 44 scoped_ptr<InputMethodDescriptors> | 37 scoped_ptr<InputMethodDescriptors> |
| 45 MockInputMethodManager::GetSupportedInputMethods() const { | 38 MockInputMethodManager::GetSupportedInputMethods() const { |
| 46 scoped_ptr<InputMethodDescriptors> result(new InputMethodDescriptors); | 39 scoped_ptr<InputMethodDescriptors> result(new InputMethodDescriptors); |
| 47 result->push_back( | 40 result->push_back( |
| 48 InputMethodDescriptor::GetFallbackInputMethodDescriptor()); | 41 InputMethodDescriptor::GetFallbackInputMethodDescriptor()); |
| 49 return result.Pass(); | 42 return result.Pass(); |
| 50 } | 43 } |
| 51 | 44 |
| 52 scoped_ptr<InputMethodDescriptors> | 45 scoped_ptr<InputMethodDescriptors> |
| 53 MockInputMethodManager::GetActiveInputMethods() const { | 46 MockInputMethodManager::GetActiveInputMethods() const { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 delegate_.set_active_locale(value); | 140 delegate_.set_active_locale(value); |
| 148 } | 141 } |
| 149 | 142 |
| 150 void MockInputMethodManager::set_hardware_keyboard_layout( | 143 void MockInputMethodManager::set_hardware_keyboard_layout( |
| 151 const std::string& value) { | 144 const std::string& value) { |
| 152 delegate_.set_hardware_keyboard_layout(value); | 145 delegate_.set_hardware_keyboard_layout(value); |
| 153 } | 146 } |
| 154 | 147 |
| 155 } // namespace input_method | 148 } // namespace input_method |
| 156 } // namespace chromeos | 149 } // namespace chromeos |
| OLD | NEW |