OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // TODO(satorux): Move this from 'cros' directory to 'input_method' | 5 // TODO(satorux): Move this from 'cros' directory to 'input_method' |
6 // directory. | 6 // directory. |
7 | 7 |
8 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ |
9 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ | 9 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/time.h" | 18 #include "base/time.h" |
19 #include "base/timer.h" | 19 #include "base/timer.h" |
20 #include "chrome/browser/chromeos/input_method/ibus_controller.h" | 20 #include "chrome/browser/chromeos/input_method/ibus_controller.h" |
21 | 21 |
22 class GURL; | 22 class GURL; |
23 | 23 |
24 namespace chromeos { | 24 namespace chromeos { |
25 namespace input_method { | 25 namespace input_method { |
26 | 26 |
27 class VirtualKeyboard; | 27 class VirtualKeyboard; |
28 | 28 |
29 | |
30 // This class manages input methodshandles. Classes can add themselves as | 29 // This class manages input methodshandles. Classes can add themselves as |
31 // observers. Clients can get an instance of this library class by: | 30 // observers. Clients can get an instance of this library class by: |
32 // InputMethodManager::GetInstance(). | 31 // InputMethodManager::GetInstance(). |
33 class InputMethodManager { | 32 class InputMethodManager { |
34 public: | 33 public: |
35 class Observer { | 34 class Observer { |
36 public: | 35 public: |
37 virtual ~Observer() {} | 36 virtual ~Observer() {} |
38 | 37 |
39 // Called when the current input method is changed. | 38 // Called when the current input method is changed. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 158 |
160 // Registers a new virtual keyboard for |layouts|. Set |is_system| true when | 159 // Registers a new virtual keyboard for |layouts|. Set |is_system| true when |
161 // the keyboard is provided as a content extension. System virtual keyboards | 160 // the keyboard is provided as a content extension. System virtual keyboards |
162 // have lower priority than non-system ones. See virtual_keyboard_selector.h | 161 // have lower priority than non-system ones. See virtual_keyboard_selector.h |
163 // for details. | 162 // for details. |
164 // TODO(yusukes): Add UnregisterVirtualKeyboard function as well. | 163 // TODO(yusukes): Add UnregisterVirtualKeyboard function as well. |
165 virtual void RegisterVirtualKeyboard(const GURL& launch_url, | 164 virtual void RegisterVirtualKeyboard(const GURL& launch_url, |
166 const std::set<std::string>& layouts, | 165 const std::set<std::string>& layouts, |
167 bool is_system) = 0; | 166 bool is_system) = 0; |
168 | 167 |
| 168 // Sets user preference on virtual keyboard selection. |
| 169 // See virtual_keyboard_selector.h for details. |
| 170 virtual bool SetVirtualKeyboardPreference(const std::string& input_method_id, |
| 171 const GURL& extention_url) = 0; |
| 172 |
| 173 // Clears all preferences on virtual keyboard selection. |
| 174 // See virtual_keyboard_selector.h for details. |
| 175 virtual void ClearVirtualKeyboardPreference() = 0; |
| 176 |
169 virtual input_method::InputMethodDescriptor previous_input_method() const = 0; | 177 virtual input_method::InputMethodDescriptor previous_input_method() const = 0; |
170 virtual input_method::InputMethodDescriptor current_input_method() const = 0; | 178 virtual input_method::InputMethodDescriptor current_input_method() const = 0; |
171 | 179 |
172 virtual const input_method::ImePropertyList& current_ime_properties() | 180 virtual const input_method::ImePropertyList& current_ime_properties() |
173 const = 0; | 181 const = 0; |
174 }; | 182 }; |
175 | 183 |
176 } // namespace input_method | 184 } // namespace input_method |
177 } // namespace chromeos | 185 } // namespace chromeos |
178 | 186 |
179 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ | 187 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |