Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: ui/base/ime/input_method_factory.cc

Issue 2408803002: Make it possible to launch chrome --mash with ozone_platform={wayland|x11}, chromeos=0 (Closed)
Patch Set: Make it possible to launch chrome --mash with ozone_platform={wayland|x11}, chromeos=0 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/base/ime/mock_input_method.h" 9 #include "ui/base/ime/mock_input_method.h"
10 10
11 #if defined(OS_CHROMEOS) 11 #if defined(OS_CHROMEOS)
12 #include "ui/base/ime/input_method_chromeos.h" 12 #include "ui/base/ime/input_method_chromeos.h"
13 #elif defined(OS_WIN) 13 #elif defined(OS_WIN)
14 #include "ui/base/ime/input_method_win.h" 14 #include "ui/base/ime/input_method_win.h"
15 #elif defined(OS_MACOSX) 15 #elif defined(OS_MACOSX)
16 #include "ui/base/ime/input_method_mac.h" 16 #include "ui/base/ime/input_method_mac.h"
17 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) 17 #elif defined(USE_AURA) && defined(OS_LINUX) && \
18 (defined(USE_X11) || defined(USE_OZONE))
18 #include "ui/base/ime/input_method_auralinux.h" 19 #include "ui/base/ime/input_method_auralinux.h"
19 #elif defined(OS_ANDROID) 20 #elif defined(OS_ANDROID)
20 #include "ui/base/ime/input_method_android.h" 21 #include "ui/base/ime/input_method_android.h"
21 #else 22 #else
22 #include "ui/base/ime/input_method_minimal.h" 23 #include "ui/base/ime/input_method_minimal.h"
23 #endif 24 #endif
24 25
25 namespace { 26 namespace {
26 27
27 ui::InputMethod* g_input_method_for_testing = nullptr; 28 ui::InputMethod* g_input_method_for_testing = nullptr;
(...skipping 20 matching lines...) Expand all
48 49
49 if (g_input_method_set_for_testing) 50 if (g_input_method_set_for_testing)
50 return base::MakeUnique<MockInputMethod>(delegate); 51 return base::MakeUnique<MockInputMethod>(delegate);
51 52
52 #if defined(OS_CHROMEOS) 53 #if defined(OS_CHROMEOS)
53 return base::MakeUnique<InputMethodChromeOS>(delegate); 54 return base::MakeUnique<InputMethodChromeOS>(delegate);
54 #elif defined(OS_WIN) 55 #elif defined(OS_WIN)
55 return base::MakeUnique<InputMethodWin>(delegate, widget); 56 return base::MakeUnique<InputMethodWin>(delegate, widget);
56 #elif defined(OS_MACOSX) 57 #elif defined(OS_MACOSX)
57 return base::MakeUnique<InputMethodMac>(delegate); 58 return base::MakeUnique<InputMethodMac>(delegate);
58 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) 59 #elif defined(USE_AURA) && defined(OS_LINUX) && \
60 (defined(USE_X11) || defined(USE_OZONE))
59 return base::MakeUnique<InputMethodAuraLinux>(delegate); 61 return base::MakeUnique<InputMethodAuraLinux>(delegate);
60 #elif defined(OS_ANDROID) 62 #elif defined(OS_ANDROID)
61 return base::MakeUnique<InputMethodAndroid>(delegate); 63 return base::MakeUnique<InputMethodAndroid>(delegate);
62 #else 64 #else
63 return base::MakeUnique<InputMethodMinimal>(delegate); 65 return base::MakeUnique<InputMethodMinimal>(delegate);
64 #endif 66 #endif
65 } 67 }
66 68
67 void SetUpInputMethodFactoryForTesting() { 69 void SetUpInputMethodFactoryForTesting() {
68 if (g_input_method_set_for_testing) 70 if (g_input_method_set_for_testing)
69 return; 71 return;
70 72
71 CHECK(!g_create_input_method_called) 73 CHECK(!g_create_input_method_called)
72 << "ui::SetUpInputMethodFactoryForTesting was called after use of " 74 << "ui::SetUpInputMethodFactoryForTesting was called after use of "
73 << "ui::CreateInputMethod. You must call " 75 << "ui::CreateInputMethod. You must call "
74 << "ui::SetUpInputMethodFactoryForTesting earlier."; 76 << "ui::SetUpInputMethodFactoryForTesting earlier.";
75 77
76 g_input_method_set_for_testing = true; 78 g_input_method_set_for_testing = true;
77 } 79 }
78 80
79 void SetUpInputMethodForTesting(InputMethod* input_method) { 81 void SetUpInputMethodForTesting(InputMethod* input_method) {
80 g_input_method_for_testing = input_method; 82 g_input_method_for_testing = input_method;
81 } 83 }
82 84
83 } // namespace ui 85 } // namespace ui
OLDNEW
« chrome/chrome_repack_locales.gni ('K') | « chrome/chrome_repack_locales.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698