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

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

Issue 2570873002: Revert of Implement a runtime headless mode for Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years 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
« no previous file with comments | « headless/lib/utility/headless_content_utility_client.cc ('k') | ui/gfx/icc_profile_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h"
8 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
9 #include "build/build_config.h" 8 #include "build/build_config.h"
10 #include "ui/base/ime/mock_input_method.h" 9 #include "ui/base/ime/mock_input_method.h"
11 #include "ui/gfx/switches.h"
12 10
13 #if defined(OS_CHROMEOS) 11 #if defined(OS_CHROMEOS)
14 #include "ui/base/ime/input_method_chromeos.h" 12 #include "ui/base/ime/input_method_chromeos.h"
15 #elif defined(OS_WIN) 13 #elif defined(OS_WIN)
16 #include "ui/base/ime/input_method_win.h" 14 #include "ui/base/ime/input_method_win.h"
17 #elif defined(OS_MACOSX) 15 #elif defined(OS_MACOSX)
18 #include "ui/base/ime/input_method_mac.h" 16 #include "ui/base/ime/input_method_mac.h"
19 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) 17 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11)
20 #include "ui/base/ime/input_method_auralinux.h" 18 #include "ui/base/ime/input_method_auralinux.h"
21 #elif defined(OS_ANDROID) 19 #elif defined(OS_ANDROID)
(...skipping 22 matching lines...) Expand all
44 42
45 if (g_input_method_for_testing) { 43 if (g_input_method_for_testing) {
46 ui::InputMethod* ret = g_input_method_for_testing; 44 ui::InputMethod* ret = g_input_method_for_testing;
47 g_input_method_for_testing = nullptr; 45 g_input_method_for_testing = nullptr;
48 return base::WrapUnique(ret); 46 return base::WrapUnique(ret);
49 } 47 }
50 48
51 if (g_input_method_set_for_testing) 49 if (g_input_method_set_for_testing)
52 return base::MakeUnique<MockInputMethod>(delegate); 50 return base::MakeUnique<MockInputMethod>(delegate);
53 51
54 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless))
55 return base::WrapUnique(new MockInputMethod(delegate));
56
57 #if defined(OS_CHROMEOS) 52 #if defined(OS_CHROMEOS)
58 return base::MakeUnique<InputMethodChromeOS>(delegate); 53 return base::MakeUnique<InputMethodChromeOS>(delegate);
59 #elif defined(OS_WIN) 54 #elif defined(OS_WIN)
60 return base::MakeUnique<InputMethodWin>(delegate, widget); 55 return base::MakeUnique<InputMethodWin>(delegate, widget);
61 #elif defined(OS_MACOSX) 56 #elif defined(OS_MACOSX)
62 return base::MakeUnique<InputMethodMac>(delegate); 57 return base::MakeUnique<InputMethodMac>(delegate);
63 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) 58 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11)
64 return base::MakeUnique<InputMethodAuraLinux>(delegate); 59 return base::MakeUnique<InputMethodAuraLinux>(delegate);
65 #elif defined(OS_ANDROID) 60 #elif defined(OS_ANDROID)
66 return base::MakeUnique<InputMethodAndroid>(delegate); 61 return base::MakeUnique<InputMethodAndroid>(delegate);
(...skipping 12 matching lines...) Expand all
79 << "ui::SetUpInputMethodFactoryForTesting earlier."; 74 << "ui::SetUpInputMethodFactoryForTesting earlier.";
80 75
81 g_input_method_set_for_testing = true; 76 g_input_method_set_for_testing = true;
82 } 77 }
83 78
84 void SetUpInputMethodForTesting(InputMethod* input_method) { 79 void SetUpInputMethodForTesting(InputMethod* input_method) {
85 g_input_method_for_testing = input_method; 80 g_input_method_for_testing = input_method;
86 } 81 }
87 82
88 } // namespace ui 83 } // namespace ui
OLDNEW
« no previous file with comments | « headless/lib/utility/headless_content_utility_client.cc ('k') | ui/gfx/icc_profile_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698