1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
|
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/base/ime/ash/mock_input_method_manager.h"
#include <utility>
#include "ui/base/ime/ash/input_method_util.h"
namespace ash {
namespace input_method {
MockInputMethodManager::State::State() = default;
scoped_refptr<InputMethodManager::State> MockInputMethodManager::State::Clone()
const {
return nullptr;
}
void MockInputMethodManager::State::AddInputMethodExtension(
const std::string& extension_id,
const InputMethodDescriptors& descriptors,
TextInputMethod* instance) {}
void MockInputMethodManager::State::RemoveInputMethodExtension(
const std::string& extension_id) {}
void MockInputMethodManager::State::ChangeInputMethod(
const std::string& input_method_id,
bool show_message) {}
void MockInputMethodManager::State::ChangeInputMethodToJpKeyboard() {}
void MockInputMethodManager::State::ChangeInputMethodToJpIme() {}
void MockInputMethodManager::State::ToggleInputMethodForJpIme() {}
bool MockInputMethodManager::State::EnableInputMethod(
const std::string& new_enabled_input_method_id) {
return true;
}
void MockInputMethodManager::State::EnableLoginLayouts(
const std::string& language_code,
const std::vector<std::string>& initial_layouts) {}
void MockInputMethodManager::State::EnableOobeInputMethods(
const std::string& language_code,
const std::vector<std::string>& initial_input_methods) {}
void MockInputMethodManager::State::DisableNonLockScreenLayouts() {}
void MockInputMethodManager::State::GetInputMethodExtensions(
InputMethodDescriptors* result) {}
InputMethodDescriptors MockInputMethodManager::State::
GetEnabledInputMethodsSortedByLocalizedDisplayNames() const {
return {};
}
InputMethodDescriptors MockInputMethodManager::State::GetEnabledInputMethods()
const {
return {};
}
const std::vector<std::string>&
MockInputMethodManager::State::GetEnabledInputMethodIds() const {
return enabled_input_method_ids;
}
const InputMethodDescriptor*
MockInputMethodManager::State::GetInputMethodFromId(
const std::string& input_method_id) const {
return nullptr;
}
size_t MockInputMethodManager::State::GetNumEnabledInputMethods() const {
return enabled_input_method_ids.size();
}
void MockInputMethodManager::State::SetEnabledExtensionImes(
base::span<const std::string> ids) {}
void MockInputMethodManager::State::SetInputMethodLoginDefault(
bool is_in_oobe_context) {}
void MockInputMethodManager::State::SetInputMethodLoginDefaultFromVPD(
const std::string& locale,
const std::string& layout) {}
void MockInputMethodManager::State::SwitchToNextInputMethod() {}
void MockInputMethodManager::State::SwitchToLastUsedInputMethod() {}
InputMethodDescriptor MockInputMethodManager::State::GetCurrentInputMethod()
const {
InputMethodDescriptor descriptor;
return descriptor;
}
bool MockInputMethodManager::State::ReplaceEnabledInputMethods(
const std::vector<std::string>& new_enabled_input_method_ids) {
enabled_input_method_ids = new_enabled_input_method_ids;
return !enabled_input_method_ids.empty();
}
bool MockInputMethodManager::State::SetAllowedInputMethods(
const std::vector<std::string>& new_allowed_input_method_ids) {
allowed_input_method_ids_ = new_allowed_input_method_ids;
return !allowed_input_method_ids_.empty();
}
const std::vector<std::string>&
MockInputMethodManager::State::GetAllowedInputMethodIds() const {
return allowed_input_method_ids_;
}
std::string MockInputMethodManager::State::GetAllowedFallBackKeyboardLayout()
const {
return "input_method_id";
}
void MockInputMethodManager::State::EnableInputView() {}
void MockInputMethodManager::State::DisableInputView() {}
const GURL& MockInputMethodManager::State::GetInputViewUrl() const {
return GURL::EmptyGURL();
}
InputMethodManager::UIStyle MockInputMethodManager::State::GetUIStyle() const {
return ui_style_;
}
void MockInputMethodManager::State::SetUIStyle(
InputMethodManager::UIStyle ui_style) {
ui_style_ = ui_style;
}
MockInputMethodManager::State::~State() = default;
MockInputMethodManager::MockInputMethodManager()
: state_(new State()),
features_enabled_state_(InputMethodManager::FEATURE_ALL) {}
MockInputMethodManager::~MockInputMethodManager() = default;
void MockInputMethodManager::AddObserver(
InputMethodManager::Observer* observer) {}
void MockInputMethodManager::AddCandidateWindowObserver(
InputMethodManager::CandidateWindowObserver* observer) {}
void MockInputMethodManager::AddImeMenuObserver(
InputMethodManager::ImeMenuObserver* observer) {}
void MockInputMethodManager::RemoveObserver(
InputMethodManager::Observer* observer) {}
void MockInputMethodManager::RemoveCandidateWindowObserver(
InputMethodManager::CandidateWindowObserver* observer) {}
void MockInputMethodManager::RemoveImeMenuObserver(
InputMethodManager::ImeMenuObserver* observer) {}
void MockInputMethodManager::ActivateInputMethodMenuItem(
const std::string& key) {}
void MockInputMethodManager::ConnectInputEngineManager(
mojo::PendingReceiver<ime::mojom::InputEngineManager> receiver) {}
void MockInputMethodManager::BindInputMethodUserDataService(
mojo::PendingReceiver<ime::mojom::InputMethodUserDataService> receiver) {}
bool MockInputMethodManager::IsISOLevel5ShiftUsedByCurrentInputMethod() const {
return false;
}
bool MockInputMethodManager::IsAltGrUsedByCurrentInputMethod() const {
return false;
}
bool MockInputMethodManager::ArePositionalShortcutsUsedByCurrentInputMethod()
const {
return false;
}
ImeKeyboard* MockInputMethodManager::GetImeKeyboard() {
return nullptr;
}
InputMethodUtil* MockInputMethodManager::GetInputMethodUtil() {
return nullptr;
}
ComponentExtensionIMEManager*
MockInputMethodManager::GetComponentExtensionIMEManager() {
return nullptr;
}
bool MockInputMethodManager::IsLoginKeyboard(const std::string& layout) const {
return true;
}
std::string MockInputMethodManager::GetMigratedInputMethodID(
const std::string& input_method_id) {
return "";
}
bool MockInputMethodManager::GetMigratedInputMethodIDs(
std::vector<std::string>* input_method_ids) {
return false;
}
scoped_refptr<InputMethodManager::State> MockInputMethodManager::CreateNewState(
Profile* profile) {
return nullptr;
}
scoped_refptr<InputMethodManager::State>
MockInputMethodManager::GetActiveIMEState() {
return state_;
}
void MockInputMethodManager::SetState(
scoped_refptr<InputMethodManager::State> state) {}
void MockInputMethodManager::ImeMenuActivationChanged(bool is_active) {}
void MockInputMethodManager::NotifyImeMenuItemsChanged(
const std::string& engine_id,
const std::vector<InputMethodManager::MenuItem>& items) {}
void MockInputMethodManager::MaybeNotifyImeMenuActivationChanged() {}
void MockInputMethodManager::OverrideKeyboardKeyset(ImeKeyset keyset) {}
void MockInputMethodManager::SetImeMenuFeatureEnabled(ImeMenuFeature feature,
bool enabled) {
if (enabled) {
features_enabled_state_ |= feature;
} else {
features_enabled_state_ &= ~feature;
}
}
bool MockInputMethodManager::GetImeMenuFeatureEnabled(
ImeMenuFeature feature) const {
return features_enabled_state_ & feature;
}
void MockInputMethodManager::NotifyObserversImeExtraInputStateChange() {}
void MockInputMethodManager::NotifyInputMethodExtensionAdded(
const std::string& extension_id) {}
void MockInputMethodManager::NotifyInputMethodExtensionRemoved(
const std::string& extension_id) {}
} // namespace input_method
} // namespace ash
|