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

Unified Diff: chrome/browser/chromeos/input_method/mock_input_method_manager.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, remove |should_hide_properties_| 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/mock_input_method_manager.cc
diff --git a/chrome/browser/chromeos/input_method/mock_input_method_manager.cc b/chrome/browser/chromeos/input_method/mock_input_method_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..914533448dbe13d395f6d3a24476e318e0354bed
--- /dev/null
+++ b/chrome/browser/chromeos/input_method/mock_input_method_manager.cc
@@ -0,0 +1,143 @@
+// 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/mock_input_method_manager.h"
+
+namespace chromeos {
+namespace input_method {
+
+MockInputMethodManager::MockInputMethodManager()
+ : add_observer_count_(0),
+ remove_observer_count_(0),
+ set_state_count_(0),
+ last_state_(STATE_TERMINATING),
+ util_(whitelist_.GetSupportedInputMethods()) {
+}
+
+MockInputMethodManager::~MockInputMethodManager() {
+}
+
+void MockInputMethodManager::AddObserver(
+ InputMethodManager::Observer* observer) {
+ ++add_observer_count_;
+}
+
+void MockInputMethodManager::AddCandidateWindowObserver(
+ InputMethodManager::CandidateWindowObserver* observer) {
+}
+
+void MockInputMethodManager::RemoveObserver(
+ InputMethodManager::Observer* observer) {
+ ++remove_observer_count_;
+}
+
+void MockInputMethodManager::RemoveCandidateWindowObserver(
+ InputMethodManager::CandidateWindowObserver* observer) {
+}
+
+void MockInputMethodManager::SetState(State new_state) {
+ ++set_state_count_;
+ last_state_ = new_state;
+}
+
+InputMethodDescriptors*
+MockInputMethodManager::GetSupportedInputMethods() const {
+ InputMethodDescriptors* result = new InputMethodDescriptors;
+ result->push_back(
+ InputMethodDescriptor::GetFallbackInputMethodDescriptor());
+ return result;
+}
+
+InputMethodDescriptors* MockInputMethodManager::GetActiveInputMethods() const {
+ InputMethodDescriptors* result = new InputMethodDescriptors;
+ result->push_back(
+ InputMethodDescriptor::GetFallbackInputMethodDescriptor());
+ return result;
+}
+
+size_t MockInputMethodManager::GetNumActiveInputMethods() const {
+ return 1;
+}
+
+void MockInputMethodManager::EnableLayouts(const std::string& language_code,
+ const std::string& initial_layout) {
+}
+
+bool MockInputMethodManager::EnableInputMethods(
+ const std::vector<std::string>& new_active_input_method_ids) {
+ return true;
+}
+
+bool MockInputMethodManager::SetInputMethodConfig(
+ const std::string& section,
+ const std::string& config_name,
+ const InputMethodConfigValue& value) {
+ return true;
+}
+
+void MockInputMethodManager::ChangeInputMethod(
+ const std::string& input_method_id) {
+}
+
+void MockInputMethodManager::ActivateInputMethodProperty(
+ const std::string& key) {
+}
+
+void MockInputMethodManager::AddInputMethodExtension(
+ const std::string& id,
+ const std::string& name,
+ const std::vector<std::string>& layouts,
+ const std::string& language) {
+}
+
+void MockInputMethodManager::RemoveInputMethodExtension(const std::string& id) {
+}
+
+void MockInputMethodManager::EnableHotkeys() {
+}
+
+void MockInputMethodManager::DisableHotkeys() {
+}
+
+bool MockInputMethodManager::SwitchToNextInputMethod() {
+ return true;
+}
+
+bool MockInputMethodManager::SwitchToPreviousInputMethod() {
+ return true;
+}
+
+bool MockInputMethodManager::SwitchInputMethod(
+ const ui::Accelerator& accelerator) {
+ return true;
+}
+
+InputMethodDescriptor MockInputMethodManager::GetCurrentInputMethod() const {
+ InputMethodDescriptor descriptor =
+ InputMethodDescriptor::GetFallbackInputMethodDescriptor();
+ if (!current_input_method_id_.empty()) {
+ return InputMethodDescriptor(whitelist_,
+ current_input_method_id_,
+ descriptor.name(),
+ descriptor.keyboard_layout(),
+ descriptor.language_code());
+ }
+ return descriptor;
+}
+
+InputMethodPropertyList
+MockInputMethodManager::GetCurrentInputMethodProperties() const {
+ return InputMethodPropertyList();
+}
+
+XKeyboard* MockInputMethodManager::GetXKeyboard() {
+ return &xkeyboard_;
+}
+
+InputMethodUtil* MockInputMethodManager::GetInputMethodUtil() {
+ return &util_;
+}
+
+} // namespace input_method
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698