Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / chrome / browser / chromeos / input_method / mock_input_method_manager.cc
blob05b605c3525a4bc5ed4f9f3bd95a66211c609817
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_input_method_manager.h"
7 namespace chromeos {
8 namespace input_method {
10 MockInputMethodManager::MockInputMethodManager()
11 : add_observer_count_(0),
12 remove_observer_count_(0),
13 set_state_count_(0),
14 last_state_(STATE_TERMINATING),
15 util_(whitelist_.GetSupportedInputMethods()) {
18 MockInputMethodManager::~MockInputMethodManager() {
21 void MockInputMethodManager::AddObserver(
22 InputMethodManager::Observer* observer) {
23 ++add_observer_count_;
26 void MockInputMethodManager::AddCandidateWindowObserver(
27 InputMethodManager::CandidateWindowObserver* observer) {
30 void MockInputMethodManager::RemoveObserver(
31 InputMethodManager::Observer* observer) {
32 ++remove_observer_count_;
35 void MockInputMethodManager::RemoveCandidateWindowObserver(
36 InputMethodManager::CandidateWindowObserver* observer) {
39 void MockInputMethodManager::SetState(State new_state) {
40 ++set_state_count_;
41 last_state_ = new_state;
44 InputMethodDescriptors*
45 MockInputMethodManager::GetSupportedInputMethods() const {
46 InputMethodDescriptors* result = new InputMethodDescriptors;
47 result->push_back(
48 InputMethodDescriptor::GetFallbackInputMethodDescriptor());
49 return result;
52 InputMethodDescriptors* MockInputMethodManager::GetActiveInputMethods() const {
53 InputMethodDescriptors* result = new InputMethodDescriptors;
54 result->push_back(
55 InputMethodDescriptor::GetFallbackInputMethodDescriptor());
56 return result;
59 size_t MockInputMethodManager::GetNumActiveInputMethods() const {
60 return 1;
63 void MockInputMethodManager::EnableLayouts(const std::string& language_code,
64 const std::string& initial_layout) {
67 bool MockInputMethodManager::EnableInputMethods(
68 const std::vector<std::string>& new_active_input_method_ids) {
69 return true;
72 bool MockInputMethodManager::SetInputMethodConfig(
73 const std::string& section,
74 const std::string& config_name,
75 const InputMethodConfigValue& value) {
76 return true;
79 void MockInputMethodManager::ChangeInputMethod(
80 const std::string& input_method_id) {
83 void MockInputMethodManager::ActivateInputMethodProperty(
84 const std::string& key) {
87 void MockInputMethodManager::AddInputMethodExtension(
88 const std::string& id,
89 const std::string& name,
90 const std::vector<std::string>& layouts,
91 const std::string& language,
92 InputMethodEngine* instance) {
95 void MockInputMethodManager::RemoveInputMethodExtension(const std::string& id) {
98 void MockInputMethodManager::GetInputMethodExtensions(
99 InputMethodDescriptors* result) {
102 void MockInputMethodManager::SetFilteredExtensionImes(
103 std::vector<std::string>* ids) {
106 bool MockInputMethodManager::SwitchToNextInputMethod() {
107 return true;
110 bool MockInputMethodManager::SwitchToPreviousInputMethod() {
111 return true;
114 bool MockInputMethodManager::SwitchInputMethod(
115 const ui::Accelerator& accelerator) {
116 return true;
119 InputMethodDescriptor MockInputMethodManager::GetCurrentInputMethod() const {
120 InputMethodDescriptor descriptor =
121 InputMethodDescriptor::GetFallbackInputMethodDescriptor();
122 if (!current_input_method_id_.empty()) {
123 return InputMethodDescriptor(current_input_method_id_,
124 descriptor.name(),
125 descriptor.keyboard_layout(),
126 descriptor.language_code(),
127 false);
129 return descriptor;
132 InputMethodPropertyList
133 MockInputMethodManager::GetCurrentInputMethodProperties() const {
134 return InputMethodPropertyList();
137 XKeyboard* MockInputMethodManager::GetXKeyboard() {
138 return &xkeyboard_;
141 InputMethodUtil* MockInputMethodManager::GetInputMethodUtil() {
142 return &util_;
145 } // namespace input_method
146 } // namespace chromeos