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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/input_method/mock_ibus_controller.h"
7 #include "chromeos/ime/input_method_property.h"
10 namespace input_method {
12 MockIBusController::MockIBusController()
13 : activate_input_method_property_count_(0),
14 activate_input_method_property_return_(true) {
17 MockIBusController::~MockIBusController() {
20 bool MockIBusController::ActivateInputMethodProperty(const std::string& key) {
21 ++activate_input_method_property_count_;
22 activate_input_method_property_key_ = key;
23 return activate_input_method_property_return_;
26 void MockIBusController::AddObserver(Observer* observer) {
27 observers_.AddObserver(observer);
30 void MockIBusController::RemoveObserver(Observer* observer) {
31 observers_.RemoveObserver(observer);
34 const InputMethodPropertyList&
35 MockIBusController::GetCurrentProperties() const {
36 return current_property_list_;
39 void MockIBusController::ClearProperties() {
40 current_property_list_.clear();
43 void MockIBusController::NotifyPropertyChangedForTesting() {
44 FOR_EACH_OBSERVER(Observer, observers_, PropertyChanged());
47 void MockIBusController::SetCurrentPropertiesForTesting(
48 const InputMethodPropertyList& current_property_list) {
49 current_property_list_ = current_property_list;
52 } // namespace input_method
53 } // namespace chromeos