Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Unified Diff: chrome/browser/chromeos/input_method/ibus_controller_base.cc

Issue 9999018: chrome/browser/chromeos/input_method/ refactoring [part 6 of 6] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/input_method/ibus_controller_base.cc
diff --git a/chrome/browser/chromeos/input_method/ibus_controller_base.cc b/chrome/browser/chromeos/input_method/ibus_controller_base.cc
new file mode 100644
index 0000000000000000000000000000000000000000..af8589551c2dd03afcf66fd2931451f34b4b6e93
--- /dev/null
+++ b/chrome/browser/chromeos/input_method/ibus_controller_base.cc
@@ -0,0 +1,67 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/input_method/ibus_controller_base.h"
+
+namespace chromeos {
+namespace input_method {
+
+IBusControllerBase::IBusControllerBase() {
+}
+
+IBusControllerBase::~IBusControllerBase() {
+}
+
+void IBusControllerBase::AddObserver(Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void IBusControllerBase::RemoveObserver(Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+bool IBusControllerBase::SetInputMethodConfig(
+ const std::string& section,
+ const std::string& config_name,
+ const InputMethodConfigValue& value) {
+ DCHECK(!section.empty());
+ DCHECK(!config_name.empty());
+
+ const ConfigKeyType key(section, config_name);
+ if (!SetInputMethodConfigInternal(key, value))
+ return false;
+ current_config_values_[key] = value;
+ return true;
+}
+
+const InputMethodPropertyList&
+IBusControllerBase::GetCurrentProperties() const {
+ return current_property_list_;
+}
+
+bool IBusControllerBase::GetInputMethodConfigForTesting(
+ const std::string& section,
+ const std::string& config_name,
+ InputMethodConfigValue* out_value) {
+ DCHECK(out_value);
+ const ConfigKeyType key(section, config_name);
+ InputMethodConfigRequests::const_iterator iter =
+ current_config_values_.find(key);
+ if (iter == current_config_values_.end())
+ return false;
+ *out_value = iter->second;
+ return true;
+}
+
+void IBusControllerBase::NotifyPropertyChangedForTesting() {
+ FOR_EACH_OBSERVER(Observer, observers_, PropertyChanged());
+}
+
+void IBusControllerBase::SetCurrentPropertiesForTesting(
+ const InputMethodPropertyList& current_property_list) {
+ current_property_list_ = current_property_list;
+}
+
+} // namespace input_method
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698