OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_BASE_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_BASE_H_ | |
7 | |
8 #include <utility> | |
9 | |
10 #include "base/observer_list.h" | |
11 #include "chrome/browser/chromeos/input_method/ibus_controller.h" | |
12 #include "chromeos/ime/input_method_property.h" | |
13 | |
14 namespace chromeos { | |
15 namespace input_method { | |
16 | |
17 // The common implementation of the IBusController. This file does not depend on | |
18 // libibus, hence is unit-testable. | |
19 class IBusControllerBase : public IBusController { | |
20 public: | |
21 IBusControllerBase(); | |
22 virtual ~IBusControllerBase(); | |
23 | |
24 // IBusController overrides. Derived classes should not override these 4 | |
25 // functions. | |
26 virtual void AddObserver(Observer* observer) OVERRIDE; | |
27 virtual void RemoveObserver(Observer* observer) OVERRIDE; | |
28 virtual const InputMethodPropertyList& GetCurrentProperties() const OVERRIDE; | |
29 virtual void ClearProperties() OVERRIDE; | |
30 | |
31 protected: | |
32 ObserverList<Observer> observers_; | |
33 | |
34 // The value which will be returned by GetCurrentProperties(). Derived classes | |
35 // should update this variable when needed. | |
36 InputMethodPropertyList current_property_list_; | |
37 | |
38 DISALLOW_COPY_AND_ASSIGN(IBusControllerBase); | |
39 }; | |
40 | |
41 } // namespace input_method | |
42 } // namespace chromeos | |
43 | |
44 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_BASE_H_ | |
OLD | NEW |