OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/observer_list.h" | 5 #include "base/observer_list.h" |
6 #include "ui/chromeos/ime/input_method_menu_item.h" | 6 #include "ui/chromeos/ime/input_method_menu_item.h" |
7 #include "ui/chromeos/ui_chromeos_export.h" | 7 #include "ui/chromeos/ui_chromeos_export.h" |
8 | 8 |
9 #ifndef UI_CHROMEOS_IME_INPUT_METHOD_MENU_MANAGER_H_ | 9 #ifndef UI_CHROMEOS_IME_INPUT_METHOD_MENU_MANAGER_H_ |
10 #define UI_CHROMEOS_IME_INPUT_METHOD_MENU_MANAGER_H_ | 10 #define UI_CHROMEOS_IME_INPUT_METHOD_MENU_MANAGER_H_ |
11 | 11 |
12 template<typename Type> struct DefaultSingletonTraits; | 12 namespace base { |
| 13 template <typename Type> |
| 14 struct DefaultSingletonTraits; |
| 15 } // namespace base |
13 | 16 |
14 namespace ui { | 17 namespace ui { |
15 namespace ime { | 18 namespace ime { |
16 | 19 |
17 class UI_CHROMEOS_EXPORT InputMethodMenuManager { | 20 class UI_CHROMEOS_EXPORT InputMethodMenuManager { |
18 public: | 21 public: |
19 class Observer { | 22 class Observer { |
20 public: | 23 public: |
21 virtual ~Observer() {} | 24 virtual ~Observer() {} |
22 | 25 |
(...skipping 17 matching lines...) Expand all Loading... |
40 // Gets the list of input method menu items. The list could be empty(). | 43 // Gets the list of input method menu items. The list could be empty(). |
41 InputMethodMenuItemList GetCurrentInputMethodMenuItemList() const; | 44 InputMethodMenuItemList GetCurrentInputMethodMenuItemList() const; |
42 | 45 |
43 // True if the key exists in the menu_list_. | 46 // True if the key exists in the menu_list_. |
44 bool HasInputMethodMenuItemForKey(const std::string& key) const; | 47 bool HasInputMethodMenuItemForKey(const std::string& key) const; |
45 | 48 |
46 private: | 49 private: |
47 InputMethodMenuManager(); | 50 InputMethodMenuManager(); |
48 | 51 |
49 // For Singleton to be able to construct an instance. | 52 // For Singleton to be able to construct an instance. |
50 friend struct DefaultSingletonTraits<InputMethodMenuManager>; | 53 friend struct base::DefaultSingletonTraits<InputMethodMenuManager>; |
51 | 54 |
52 // Menu item list of the input method. This is set by extension IMEs. | 55 // Menu item list of the input method. This is set by extension IMEs. |
53 InputMethodMenuItemList menu_list_; | 56 InputMethodMenuItemList menu_list_; |
54 | 57 |
55 // Observers who will be notified when menu changes. | 58 // Observers who will be notified when menu changes. |
56 base::ObserverList<Observer> observers_; | 59 base::ObserverList<Observer> observers_; |
57 | 60 |
58 DISALLOW_COPY_AND_ASSIGN(InputMethodMenuManager); | 61 DISALLOW_COPY_AND_ASSIGN(InputMethodMenuManager); |
59 }; | 62 }; |
60 | 63 |
61 } // namespace ime | 64 } // namespace ime |
62 } // namespace ui | 65 } // namespace ui |
63 | 66 |
64 #endif // UI_CHROMEOS_IME_INPUT_METHOD_MENU_MANAGER_H_ | 67 #endif // UI_CHROMEOS_IME_INPUT_METHOD_MENU_MANAGER_H_ |
OLD | NEW |