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

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

Issue 2872343003: Remove InputMethodEventHandler. (Closed)
Patch Set: addressed feedback. Created 3 years, 7 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
« no previous file with comments | « ash/host/ash_window_tree_host_x11.h ('k') | ash/ime/input_method_event_handler.h » ('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 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>
11 #include <string> 11 #include <string>
12 #include <utility> 12 #include <utility>
13 #include <vector> 13 #include <vector>
14 14
15 #include "ash/host/ash_window_tree_host_init_params.h" 15 #include "ash/host/ash_window_tree_host_init_params.h"
16 #include "ash/host/ash_window_tree_host_unified.h" 16 #include "ash/host/ash_window_tree_host_unified.h"
17 #include "ash/host/root_window_transformer.h" 17 #include "ash/host/root_window_transformer.h"
18 #include "ash/ime/input_method_event_handler.h"
19 #include "base/sys_info.h" 18 #include "base/sys_info.h"
20 #include "ui/aura/env.h" 19 #include "ui/aura/env.h"
21 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
22 #include "ui/aura/window_event_dispatcher.h" 21 #include "ui/aura/window_event_dispatcher.h"
23 #include "ui/base/x/x11_util.h" 22 #include "ui/base/x/x11_util.h"
24 #include "ui/display/screen.h" 23 #include "ui/display/screen.h"
25 #include "ui/display/types/display_constants.h" 24 #include "ui/display/types/display_constants.h"
26 #include "ui/events/devices/device_data_manager.h" 25 #include "ui/events/devices/device_data_manager.h"
27 #include "ui/events/devices/x11/device_list_cache_x11.h" 26 #include "ui/events/devices/x11/device_list_cache_x11.h"
28 #include "ui/events/devices/x11/touch_factory_x11.h" 27 #include "ui/events/devices/x11/touch_factory_x11.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return true; 205 return true;
207 } 206 }
208 } 207 }
209 208
210 void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent( 209 void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent(
211 ui::LocatedEvent* event) { 210 ui::LocatedEvent* event) {
212 TranslateLocatedEvent(event); 211 TranslateLocatedEvent(event);
213 SendEventToSink(event); 212 SendEventToSink(event);
214 } 213 }
215 214
216 ui::EventDispatchDetails AshWindowTreeHostX11::DispatchKeyEventPostIME(
217 ui::KeyEvent* event) {
218 input_method_handler()->SetPostIME(true);
219 ui::EventDispatchDetails details = event_sink()->OnEventFromSource(event);
220 if (!details.dispatcher_destroyed)
221 input_method_handler()->SetPostIME(false);
222 return details;
223 }
224
225 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { 215 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) {
226 if (!ui::IsXInput2Available()) 216 if (!ui::IsXInput2Available())
227 return; 217 return;
228 // Temporarily pause tap-to-click when the cursor is hidden. 218 // Temporarily pause tap-to-click when the cursor is hidden.
229 Atom prop = atom_cache()->GetAtom("Tap Paused"); 219 Atom prop = atom_cache()->GetAtom("Tap Paused");
230 unsigned char value = state; 220 unsigned char value = state;
231 const XIDeviceList& dev_list = 221 const XIDeviceList& dev_list =
232 ui::DeviceListCacheX11::GetInstance()->GetXI2DeviceList(xdisplay()); 222 ui::DeviceListCacheX11::GetInstance()->GetXI2DeviceList(xdisplay());
233 223
234 // Only slave pointer devices could possibly have tap-paused property. 224 // Only slave pointer devices could possibly have tap-paused property.
235 for (int i = 0; i < dev_list.count; i++) { 225 for (int i = 0; i < dev_list.count; i++) {
236 if (dev_list[i].use == XISlavePointer) { 226 if (dev_list[i].use == XISlavePointer) {
237 Atom old_type; 227 Atom old_type;
238 int old_format; 228 int old_format;
239 unsigned long old_nvalues, bytes; 229 unsigned long old_nvalues, bytes;
240 unsigned char* data; 230 unsigned char* data;
241 int result = XIGetProperty(xdisplay(), dev_list[i].deviceid, prop, 0, 0, 231 int result = XIGetProperty(xdisplay(), dev_list[i].deviceid, prop, 0, 0,
242 False, AnyPropertyType, &old_type, &old_format, 232 False, AnyPropertyType, &old_type, &old_format,
243 &old_nvalues, &bytes, &data); 233 &old_nvalues, &bytes, &data);
244 if (result != Success) 234 if (result != Success)
245 continue; 235 continue;
246 XFree(data); 236 XFree(data);
247 XIChangeProperty(xdisplay(), dev_list[i].deviceid, prop, XA_INTEGER, 8, 237 XIChangeProperty(xdisplay(), dev_list[i].deviceid, prop, XA_INTEGER, 8,
248 PropModeReplace, &value, 1); 238 PropModeReplace, &value, 1);
249 } 239 }
250 } 240 }
251 } 241 }
252 242
253 } // namespace ash 243 } // namespace ash
OLDNEW
« no previous file with comments | « ash/host/ash_window_tree_host_x11.h ('k') | ash/ime/input_method_event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698