| 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(OS_LINUX) |
| 18 #include "ui/base/ime/input_method_auralinux.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) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 internal::InputMethodDelegate* delegate, | 65 internal::InputMethodDelegate* delegate, |
| 66 gfx::AcceleratedWidget widget) { | 66 gfx::AcceleratedWidget widget) { |
| 67 #if defined(OS_CHROMEOS) && defined(USE_X11) | 67 #if defined(OS_CHROMEOS) && defined(USE_X11) |
| 68 return scoped_ptr<InputMethod>(new InputMethodIBus(delegate)); | 68 return scoped_ptr<InputMethod>(new InputMethodIBus(delegate)); |
| 69 #elif defined(OS_WIN) | 69 #elif defined(OS_WIN) |
| 70 if (base::win::IsTSFAwareRequired()) | 70 if (base::win::IsTSFAwareRequired()) |
| 71 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); | 71 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); |
| 72 if (IsRemoteInputMethodWinRequired(widget)) | 72 if (IsRemoteInputMethodWinRequired(widget)) |
| 73 return CreateRemoteInputMethodWin(delegate); | 73 return CreateRemoteInputMethodWin(delegate); |
| 74 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); | 74 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); |
| 75 #elif defined(USE_AURA) && defined(USE_X11) | 75 #elif defined(USE_AURA) && defined(OS_LINUX) |
| 76 return scoped_ptr<InputMethod>(new InputMethodAuraLinux(delegate)); | 76 return scoped_ptr<InputMethod>(new InputMethodAuraLinux(delegate)); |
| 77 #else | 77 #else |
| 78 return scoped_ptr<InputMethod>(new InputMethodMinimal(delegate)); | 78 return scoped_ptr<InputMethod>(new InputMethodMinimal(delegate)); |
| 79 #endif | 79 #endif |
| 80 } | 80 } |
| 81 | 81 |
| 82 // MockInputMethodFactory | 82 // MockInputMethodFactory |
| 83 | 83 |
| 84 // static | 84 // static |
| 85 MockInputMethodFactory* MockInputMethodFactory::GetInstance() { | 85 MockInputMethodFactory* MockInputMethodFactory::GetInstance() { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 115 | 115 |
| 116 void DestroySharedInputMethod() { | 116 void DestroySharedInputMethod() { |
| 117 delete g_shared_input_method; | 117 delete g_shared_input_method; |
| 118 g_shared_input_method = NULL; | 118 g_shared_input_method = NULL; |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace internal | 121 } // namespace internal |
| 122 #endif | 122 #endif |
| 123 | 123 |
| 124 } // namespace ui | 124 } // namespace ui |
| OLD | NEW |