OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ | 5 #ifndef UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ |
6 #define UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ | 6 #define UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include <memory> |
| 9 |
9 #include "ui/base/ime/ui_base_ime_export.h" | 10 #include "ui/base/ime/ui_base_ime_export.h" |
10 | 11 |
11 namespace ui { | 12 namespace ui { |
12 | 13 |
13 class LinuxInputMethodContext; | 14 class LinuxInputMethodContext; |
14 class LinuxInputMethodContextDelegate; | 15 class LinuxInputMethodContextDelegate; |
15 | 16 |
16 // An interface that lets different Linux platforms override the | 17 // An interface that lets different Linux platforms override the |
17 // CreateInputMethodContext function declared here to return native input method | 18 // CreateInputMethodContext function declared here to return native input method |
18 // contexts. | 19 // contexts. |
19 class UI_BASE_IME_EXPORT LinuxInputMethodContextFactory { | 20 class UI_BASE_IME_EXPORT LinuxInputMethodContextFactory { |
20 public: | 21 public: |
21 // Returns the current active factory or NULL. | 22 // Returns the current active factory or NULL. |
22 static const LinuxInputMethodContextFactory* instance(); | 23 static const LinuxInputMethodContextFactory* instance(); |
23 | 24 |
24 // Sets the dynamically loaded singleton that creates an input method context. | 25 // Sets the dynamically loaded singleton that creates an input method context. |
25 // This pointer is not owned, and if this method is called a second time, | 26 // This pointer is not owned, and if this method is called a second time, |
26 // the first instance is not deleted. | 27 // the first instance is not deleted. |
27 static void SetInstance(const LinuxInputMethodContextFactory* instance); | 28 static void SetInstance(const LinuxInputMethodContextFactory* instance); |
28 | 29 |
29 virtual ~LinuxInputMethodContextFactory() {} | 30 virtual ~LinuxInputMethodContextFactory() {} |
30 | 31 |
31 // Returns a native input method context. | 32 // Returns a native input method context. |
32 virtual scoped_ptr<LinuxInputMethodContext> CreateInputMethodContext( | 33 virtual std::unique_ptr<LinuxInputMethodContext> CreateInputMethodContext( |
33 LinuxInputMethodContextDelegate* delegate, | 34 LinuxInputMethodContextDelegate* delegate, |
34 bool is_simple) const = 0; | 35 bool is_simple) const = 0; |
35 }; | 36 }; |
36 | 37 |
37 } // namespace ui | 38 } // namespace ui |
38 | 39 |
39 #endif // UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ | 40 #endif // UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ |
OLD | NEW |