OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "ui/base/ime/input_method_factory.h" | 5 #include "ui/base/ime/input_method_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "ui/base/ime/mock_input_method.h" | 8 #include "ui/base/ime/mock_input_method.h" |
9 | 9 |
10 #if defined(OS_CHROMEOS) && defined(USE_X11) | 10 #if defined(OS_CHROMEOS) && defined(USE_X11) |
11 #include "ui/base/ime/input_method_ibus.h" | 11 #include "ui/base/ime/input_method_ibus.h" |
12 #elif defined(OS_WIN) | 12 #elif defined(OS_WIN) |
13 #include "base/win/metro.h" | 13 #include "base/win/metro.h" |
14 #include "ui/base/ime/input_method_imm32.h" | 14 #include "ui/base/ime/input_method_imm32.h" |
15 #include "ui/base/ime/input_method_tsf.h" | 15 #include "ui/base/ime/input_method_tsf.h" |
16 #include "ui/base/ime/remote_input_method_win.h" | 16 #include "ui/base/ime/remote_input_method_win.h" |
17 #elif defined(USE_AURA) && defined(USE_X11) | 17 #elif defined(USE_AURA) && defined(USE_X11) |
18 #include "ui/base/ime/input_method_linux_x11.h" | 18 #include "ui/base/ime/input_method_auralinux.h" |
19 #else | 19 #else |
20 #include "ui/base/ime/input_method_minimal.h" | 20 #include "ui/base/ime/input_method_minimal.h" |
21 #endif | 21 #endif |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 ui::InputMethodFactory* g_input_method_factory = NULL; | 25 ui::InputMethodFactory* g_input_method_factory = NULL; |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 ui::InputMethod* g_shared_input_method = NULL; | 28 ui::InputMethod* g_shared_input_method = NULL; |
(...skipping 28 matching lines...) Expand all Loading... |
57 gfx::AcceleratedWidget widget) { | 57 gfx::AcceleratedWidget widget) { |
58 #if defined(OS_CHROMEOS) && defined(USE_X11) | 58 #if defined(OS_CHROMEOS) && defined(USE_X11) |
59 return scoped_ptr<InputMethod>(new InputMethodIBus(delegate)); | 59 return scoped_ptr<InputMethod>(new InputMethodIBus(delegate)); |
60 #elif defined(OS_WIN) | 60 #elif defined(OS_WIN) |
61 if (base::win::IsTSFAwareRequired()) | 61 if (base::win::IsTSFAwareRequired()) |
62 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); | 62 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); |
63 if (IsRemoteInputMethodWinRequired(widget)) | 63 if (IsRemoteInputMethodWinRequired(widget)) |
64 return CreateRemoteInputMethodWin(delegate); | 64 return CreateRemoteInputMethodWin(delegate); |
65 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); | 65 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); |
66 #elif defined(USE_AURA) && defined(USE_X11) | 66 #elif defined(USE_AURA) && defined(USE_X11) |
67 return scoped_ptr<InputMethod>(new InputMethodLinuxX11(delegate)); | 67 return scoped_ptr<InputMethod>(new InputMethodAuraLinux(delegate)); |
68 #else | 68 #else |
69 return scoped_ptr<InputMethod>(new InputMethodMinimal(delegate)); | 69 return scoped_ptr<InputMethod>(new InputMethodMinimal(delegate)); |
70 #endif | 70 #endif |
71 } | 71 } |
72 | 72 |
73 // MockInputMethodFactory | 73 // MockInputMethodFactory |
74 | 74 |
75 // static | 75 // static |
76 MockInputMethodFactory* MockInputMethodFactory::GetInstance() { | 76 MockInputMethodFactory* MockInputMethodFactory::GetInstance() { |
77 return Singleton<MockInputMethodFactory>::get(); | 77 return Singleton<MockInputMethodFactory>::get(); |
(...skipping 28 matching lines...) Expand all Loading... |
106 | 106 |
107 void DestroySharedInputMethod() { | 107 void DestroySharedInputMethod() { |
108 delete g_shared_input_method; | 108 delete g_shared_input_method; |
109 g_shared_input_method = NULL; | 109 g_shared_input_method = NULL; |
110 } | 110 } |
111 | 111 |
112 } // namespace internal | 112 } // namespace internal |
113 #endif | 113 #endif |
114 | 114 |
115 } // namespace ui | 115 } // namespace ui |
OLD | NEW |