- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / input_method / mock_ibus_controller.cc
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.
4
5 #include "chrome/browser/chromeos/input_method/mock_ibus_controller.h"
6
7 #include "chromeos/ime/input_method_property.h"
8
9 namespace chromeos {
10 namespace input_method {
11
12 MockIBusController::MockIBusController()
13     : activate_input_method_property_count_(0),
14       activate_input_method_property_return_(true) {
15 }
16
17 MockIBusController::~MockIBusController() {
18 }
19
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_;
24 }
25
26 void MockIBusController::AddObserver(Observer* observer) {
27   observers_.AddObserver(observer);
28 }
29
30 void MockIBusController::RemoveObserver(Observer* observer) {
31   observers_.RemoveObserver(observer);
32 }
33
34 const InputMethodPropertyList&
35 MockIBusController::GetCurrentProperties() const {
36   return current_property_list_;
37 }
38
39 void MockIBusController::ClearProperties() {
40   current_property_list_.clear();
41 }
42
43 void MockIBusController::NotifyPropertyChangedForTesting() {
44   FOR_EACH_OBSERVER(Observer, observers_, PropertyChanged());
45 }
46
47 void MockIBusController::SetCurrentPropertiesForTesting(
48     const InputMethodPropertyList& current_property_list) {
49   current_property_list_ = current_property_list;
50 }
51
52 }  // namespace input_method
53 }  // namespace chromeos