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 #include "ui/base/ime/input_method_initializer.h" | 5 #include "ui/base/ime/input_method_initializer.h" |
6 | 6 |
7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
8 #include "ui/base/ime/chromeos/ime_bridge.h" | 8 #include "ui/base/ime/chromeos/ime_bridge.h" |
9 #elif defined(USE_AURA) && defined(OS_LINUX) && !defined(USE_OZONE) | 9 #elif defined(USE_AURA) && defined(OS_LINUX) && !defined(USE_OZONE) |
10 #include "ui/base/ime/input_method_auralinux.h" | 10 #include "base/logging.h" |
11 #include "ui/base/ime/linux/fake_input_method_context_factory.h" | 11 #include "ui/base/ime/linux/fake_input_method_context_factory.h" |
12 #endif | 12 #endif |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) && \ | 16 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) && \ |
17 !defined(USE_OZONE) | 17 !defined(USE_OZONE) |
18 const ui::LinuxInputMethodContextFactory* g_linux_input_method_context_factory; | 18 const ui::LinuxInputMethodContextFactory* g_linux_input_method_context_factory; |
19 #endif | 19 #endif |
20 | 20 |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 namespace ui { | 23 namespace ui { |
24 | 24 |
25 void InitializeInputMethod() { | 25 void InitializeInputMethod() { |
26 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
27 chromeos::IMEBridge::Initialize(); | 27 chromeos::IMEBridge::Initialize(); |
28 #elif defined(USE_AURA) && defined(OS_LINUX) && !defined(USE_OZONE) | |
29 InputMethodAuraLinux::Initialize(); | |
30 #endif | 28 #endif |
31 } | 29 } |
32 | 30 |
33 void ShutdownInputMethod() { | 31 void ShutdownInputMethod() { |
34 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
35 chromeos::IMEBridge::Shutdown(); | 33 chromeos::IMEBridge::Shutdown(); |
36 #endif | 34 #endif |
37 } | 35 } |
38 | 36 |
39 void InitializeInputMethodForTesting() { | 37 void InitializeInputMethodForTesting() { |
(...skipping 20 matching lines...) Expand all Loading... |
60 LinuxInputMethodContextFactory::instance(); | 58 LinuxInputMethodContextFactory::instance(); |
61 CHECK(!factory || factory == g_linux_input_method_context_factory) | 59 CHECK(!factory || factory == g_linux_input_method_context_factory) |
62 << "An unknown LinuxInputMethodContextFactory was set."; | 60 << "An unknown LinuxInputMethodContextFactory was set."; |
63 LinuxInputMethodContextFactory::SetInstance(NULL); | 61 LinuxInputMethodContextFactory::SetInstance(NULL); |
64 delete g_linux_input_method_context_factory; | 62 delete g_linux_input_method_context_factory; |
65 g_linux_input_method_context_factory = NULL; | 63 g_linux_input_method_context_factory = NULL; |
66 #endif | 64 #endif |
67 } | 65 } |
68 | 66 |
69 } // namespace ui | 67 } // namespace ui |
OLD | NEW |