| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_CROS_FAKE_FAKE_INPUT_METHOD_LIBRARY_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_FAKE_FAKE_INPUT_METHOD_LIBRARY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/scoped_ptr.h" | |
| 11 #include "chrome/browser/chromeos/cros/input_method_library.h" | |
| 12 #include "third_party/cros/chromeos_input_method.h" | |
| 13 | |
| 14 namespace chromeos { | |
| 15 | |
| 16 class FakeInputMethodLibrary : public InputMethodLibrary { | |
| 17 public: | |
| 18 FakeInputMethodLibrary() | |
| 19 : previous_input_method_("", "", "", ""), | |
| 20 current_input_method_("", "", "", "") { | |
| 21 } | |
| 22 | |
| 23 virtual ~FakeInputMethodLibrary() {} | |
| 24 virtual void AddObserver(Observer* observer) {} | |
| 25 virtual void RemoveObserver(Observer* observer) {} | |
| 26 virtual InputMethodDescriptors* GetActiveInputMethods() { | |
| 27 return CreateFallbackInputMethodDescriptors(); | |
| 28 } | |
| 29 virtual size_t GetNumActiveInputMethods() { | |
| 30 scoped_ptr<InputMethodDescriptors> input_methods(GetActiveInputMethods()); | |
| 31 return input_methods->size(); | |
| 32 } | |
| 33 virtual InputMethodDescriptors* GetSupportedInputMethods() { | |
| 34 return CreateFallbackInputMethodDescriptors(); | |
| 35 } | |
| 36 virtual void ChangeInputMethod(const std::string& input_method_id) {} | |
| 37 virtual void SetImePropertyActivated(const std::string& key, | |
| 38 bool activated) {} | |
| 39 virtual bool InputMethodIsActivated(const std::string& input_method_id) { | |
| 40 return true; | |
| 41 } | |
| 42 virtual bool GetImeConfig( | |
| 43 const char* section, const char* config_name, ImeConfigValue* out_value) { | |
| 44 return true; | |
| 45 } | |
| 46 virtual bool SetImeConfig(const char* section, | |
| 47 const char* config_name, | |
| 48 const ImeConfigValue& value) { | |
| 49 return true; | |
| 50 } | |
| 51 | |
| 52 virtual const InputMethodDescriptor& previous_input_method() const { | |
| 53 return previous_input_method_; | |
| 54 } | |
| 55 virtual const InputMethodDescriptor& current_input_method() const { | |
| 56 return current_input_method_; | |
| 57 } | |
| 58 | |
| 59 virtual const ImePropertyList& current_ime_properties() const { | |
| 60 return current_ime_properties_; | |
| 61 } | |
| 62 | |
| 63 private: | |
| 64 InputMethodDescriptor previous_input_method_; | |
| 65 InputMethodDescriptor current_input_method_; | |
| 66 ImePropertyList current_ime_properties_; | |
| 67 }; | |
| 68 | |
| 69 } // namespace chromeos | |
| 70 | |
| 71 #endif // CHROME_BROWSER_CHROMEOS_CROS_FAKE_FAKE_INPUT_METHOD_LIBRARY_H_ | |
| OLD | NEW |