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 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include <glib.h> | 9 #include <glib.h> |
10 | 10 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 | 291 |
292 virtual void RegisterVirtualKeyboard(const GURL& launch_url, | 292 virtual void RegisterVirtualKeyboard(const GURL& launch_url, |
293 const std::set<std::string>& layouts, | 293 const std::set<std::string>& layouts, |
294 bool is_system) { | 294 bool is_system) { |
295 virtual_keyboard_selector_.AddVirtualKeyboard(launch_url, | 295 virtual_keyboard_selector_.AddVirtualKeyboard(launch_url, |
296 layouts, | 296 layouts, |
297 is_system); | 297 is_system); |
298 } | 298 } |
299 | 299 |
| 300 virtual bool SetVirtualKeyboardPreference(const std::string& input_method_id, |
| 301 const GURL& extention_url) { |
| 302 return virtual_keyboard_selector_.SetUserPreference( |
| 303 input_method_id, extention_url); |
| 304 } |
| 305 |
| 306 virtual void ClearVirtualKeyboardPreference() { |
| 307 return virtual_keyboard_selector_.ClearUserPreference(); |
| 308 } |
| 309 |
300 static InputMethodManagerImpl* GetInstance() { | 310 static InputMethodManagerImpl* GetInstance() { |
301 return Singleton<InputMethodManagerImpl, | 311 return Singleton<InputMethodManagerImpl, |
302 DefaultSingletonTraits<InputMethodManagerImpl> >::get(); | 312 DefaultSingletonTraits<InputMethodManagerImpl> >::get(); |
303 } | 313 } |
304 | 314 |
305 private: | 315 private: |
306 friend struct DefaultSingletonTraits<InputMethodManagerImpl>; | 316 friend struct DefaultSingletonTraits<InputMethodManagerImpl>; |
307 | 317 |
308 // Returns true if the given input method config value is a single | 318 // Returns true if the given input method config value is a single |
309 // element string list that contains an input method ID of a keyboard | 319 // element string list that contains an input method ID of a keyboard |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 return InputMethodManagerImpl::GetInstance(); | 956 return InputMethodManagerImpl::GetInstance(); |
947 } | 957 } |
948 | 958 |
949 } // namespace input_method | 959 } // namespace input_method |
950 } // namespace chromeos | 960 } // namespace chromeos |
951 | 961 |
952 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 962 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
953 // won't be deleted until it's last InvokeLater is run. | 963 // won't be deleted until it's last InvokeLater is run. |
954 DISABLE_RUNNABLE_METHOD_REFCOUNT( | 964 DISABLE_RUNNABLE_METHOD_REFCOUNT( |
955 chromeos::input_method::InputMethodManagerImpl); | 965 chromeos::input_method::InputMethodManagerImpl); |
OLD | NEW |