OLD | NEW |
(Empty) | |
| 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/ibus_controller_base.h" |
| 6 |
| 7 namespace chromeos { |
| 8 namespace input_method { |
| 9 |
| 10 IBusControllerBase::IBusControllerBase() { |
| 11 } |
| 12 |
| 13 IBusControllerBase::~IBusControllerBase() { |
| 14 } |
| 15 |
| 16 void IBusControllerBase::AddObserver(Observer* observer) { |
| 17 observers_.AddObserver(observer); |
| 18 } |
| 19 |
| 20 void IBusControllerBase::RemoveObserver(Observer* observer) { |
| 21 observers_.RemoveObserver(observer); |
| 22 } |
| 23 |
| 24 bool IBusControllerBase::SetInputMethodConfig( |
| 25 const std::string& section, |
| 26 const std::string& config_name, |
| 27 const InputMethodConfigValue& value) { |
| 28 DCHECK(!section.empty()); |
| 29 DCHECK(!config_name.empty()); |
| 30 |
| 31 const ConfigKeyType key(section, config_name); |
| 32 current_config_values_[key] = value; |
| 33 return SetInputMethodConfigInternal(key, value); |
| 34 } |
| 35 |
| 36 const InputMethodPropertyList& |
| 37 IBusControllerBase::GetCurrentProperties() const { |
| 38 return current_property_list_; |
| 39 } |
| 40 |
| 41 bool IBusControllerBase::GetInputMethodConfigForTesting( |
| 42 const std::string& section, |
| 43 const std::string& config_name, |
| 44 InputMethodConfigValue* out_value) { |
| 45 DCHECK(out_value); |
| 46 const ConfigKeyType key = std::make_pair(section, config_name); |
| 47 InputMethodConfigRequests::const_iterator iter |
| 48 = current_config_values_.find(key); |
| 49 if (iter == current_config_values_.end()) |
| 50 return false; |
| 51 *out_value = iter->second; |
| 52 return true; |
| 53 } |
| 54 |
| 55 void IBusControllerBase::NotifyPropertyChangedForTesting() { |
| 56 FOR_EACH_OBSERVER(Observer, observers_, PropertyChanged()); |
| 57 } |
| 58 |
| 59 void IBusControllerBase::SetCurrentPropertiesForTesting( |
| 60 const InputMethodPropertyList& current_property_list) { |
| 61 current_property_list_ = current_property_list; |
| 62 } |
| 63 |
| 64 } // namespace input_method |
| 65 } // namespace chromeos |
OLD | NEW |