OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/ime_keyboard_x11.h" | 5 #include "ui/base/ime/chromeos/ime_keyboard_x11.h" |
6 | 6 |
7 #include <X11/XKBlib.h> | 7 #include <X11/XKBlib.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 #include "ui/gfx/x/x11_types.h" | 10 #include "ui/gfx/x/x11_types.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 base::Process process = base::LaunchProcess(argv, base::LaunchOptions()); | 166 base::Process process = base::LaunchProcess(argv, base::LaunchOptions()); |
167 if (!process.IsValid()) { | 167 if (!process.IsValid()) { |
168 DVLOG(1) << "Failed to execute setxkbmap: " << layout_to_set; | 168 DVLOG(1) << "Failed to execute setxkbmap: " << layout_to_set; |
169 execute_queue_ = std::queue<std::string>(); // clear the queue. | 169 execute_queue_ = std::queue<std::string>(); // clear the queue. |
170 return; | 170 return; |
171 } | 171 } |
172 | 172 |
173 PollUntilChildFinish(process.Handle()); | 173 PollUntilChildFinish(process.Handle()); |
174 | 174 |
175 DVLOG(1) << "ExecuteSetLayoutCommand: " << layout_to_set | 175 DVLOG(1) << "ExecuteSetLayoutCommand: " << layout_to_set |
176 << ": pid=" << process.pid(); | 176 << ": pid=" << process.Pid(); |
177 } | 177 } |
178 | 178 |
179 // Delay and loop until child process finishes and call the callback. | 179 // Delay and loop until child process finishes and call the callback. |
180 void ImeKeyboardX11::PollUntilChildFinish(const base::ProcessHandle handle) { | 180 void ImeKeyboardX11::PollUntilChildFinish(const base::ProcessHandle handle) { |
181 int exit_code; | 181 int exit_code; |
182 DVLOG(1) << "PollUntilChildFinish: poll for pid=" << base::GetProcId(handle); | 182 DVLOG(1) << "PollUntilChildFinish: poll for pid=" << base::GetProcId(handle); |
183 switch (base::GetTerminationStatus(handle, &exit_code)) { | 183 switch (base::GetTerminationStatus(handle, &exit_code)) { |
184 case base::TERMINATION_STATUS_STILL_RUNNING: | 184 case base::TERMINATION_STATUS_STILL_RUNNING: |
185 DVLOG(1) << "PollUntilChildFinish: Try waiting again"; | 185 DVLOG(1) << "PollUntilChildFinish: Try waiting again"; |
186 base::MessageLoop::current()->PostDelayedTask( | 186 base::MessageLoop::current()->PostDelayedTask( |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 return CheckLayoutName(layout_name); | 296 return CheckLayoutName(layout_name); |
297 } | 297 } |
298 | 298 |
299 // static | 299 // static |
300 ImeKeyboard* ImeKeyboard::Create() { | 300 ImeKeyboard* ImeKeyboard::Create() { |
301 return new ImeKeyboardX11(); | 301 return new ImeKeyboardX11(); |
302 } | 302 } |
303 | 303 |
304 } // namespace input_method | 304 } // namespace input_method |
305 } // namespace chromeos | 305 } // namespace chromeos |
OLD | NEW |