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

Side by Side Diff: ash/host/ash_window_tree_host_x11.cc

Issue 1236923003: Makes DesktopWindowTreeHostXxx to dispatch key event to InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 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 "ash/host/ash_window_tree_host_x11.h" 5 #include "ash/host/ash_window_tree_host_x11.h"
6 6
7 #include <X11/extensions/Xfixes.h> 7 #include <X11/extensions/Xfixes.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent( 233 void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent(
234 ui::LocatedEvent* event) { 234 ui::LocatedEvent* event) {
235 TranslateLocatedEvent(event); 235 TranslateLocatedEvent(event);
236 SendEventToProcessor(event); 236 SendEventToProcessor(event);
237 } 237 }
238 238
239 bool AshWindowTreeHostX11::DispatchKeyEventPostIME(const ui::KeyEvent& event) { 239 bool AshWindowTreeHostX11::DispatchKeyEventPostIME(const ui::KeyEvent& event) {
240 ui::KeyEvent event_copy(event); 240 ui::KeyEvent event_copy(event);
241 input_method_handler()->SetPostIME(true); 241 input_method_handler()->SetPostIME(true);
242 ui::EventSource::DeliverEventToProcessor(&event_copy); 242 ui::EventDispatchDetails details =
243 event_processor()->OnEventFromSource(&event_copy);
244 DCHECK(!details.dispatcher_destroyed);
sadrul 2015/07/19 01:07:30 Do these DCHECK()s not trip when, for example, ctr
Shu Chen 2015/07/20 05:46:09 Done. I've changed it to use ignore_result().
sadrul 2015/07/22 01:04:38 This should either be a DCHECK, or an early return
Shu Chen 2015/07/22 01:19:06 Done.
243 input_method_handler()->SetPostIME(false); 245 input_method_handler()->SetPostIME(false);
244 return event_copy.stopped_propagation(); 246 return event_copy.stopped_propagation();
245 } 247 }
246 248
247 ui::EventDispatchDetails AshWindowTreeHostX11::DeliverEventToProcessor(
248 ui::Event* event) {
249 return ui::EventSource::DeliverEventToProcessor(event);
250 }
251
252 #if defined(OS_CHROMEOS) 249 #if defined(OS_CHROMEOS)
253 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { 250 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) {
254 if (!ui::IsXInput2Available()) 251 if (!ui::IsXInput2Available())
255 return; 252 return;
256 // Temporarily pause tap-to-click when the cursor is hidden. 253 // Temporarily pause tap-to-click when the cursor is hidden.
257 Atom prop = atom_cache()->GetAtom("Tap Paused"); 254 Atom prop = atom_cache()->GetAtom("Tap Paused");
258 unsigned char value = state; 255 unsigned char value = state;
259 const XIDeviceList& dev_list = 256 const XIDeviceList& dev_list =
260 ui::DeviceListCacheX11::GetInstance()->GetXI2DeviceList(xdisplay()); 257 ui::DeviceListCacheX11::GetInstance()->GetXI2DeviceList(xdisplay());
261 258
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 #endif 292 #endif
296 293
297 AshWindowTreeHost* AshWindowTreeHost::Create( 294 AshWindowTreeHost* AshWindowTreeHost::Create(
298 const AshWindowTreeHostInitParams& init_params) { 295 const AshWindowTreeHostInitParams& init_params) {
299 if (init_params.offscreen) 296 if (init_params.offscreen)
300 return new AshWindowTreeHostUnified(init_params.initial_bounds); 297 return new AshWindowTreeHostUnified(init_params.initial_bounds);
301 return new AshWindowTreeHostX11(init_params.initial_bounds); 298 return new AshWindowTreeHostX11(init_params.initial_bounds);
302 } 299 }
303 300
304 } // namespace ash 301 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698