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

Side by Side Diff: ash/wm/maximize_mode/internal_input_device_list_x11.cc

Issue 294033016: Fix crash on key events in touchview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/wm/maximize_mode/internal_input_device_list_x11.h" 5 #include "ash/wm/maximize_mode/internal_input_device_list_x11.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 26 matching lines...) Expand all
37 internal_device_ids_.insert(xi_dev_list[i].deviceid); 37 internal_device_ids_.insert(xi_dev_list[i].deviceid);
38 } 38 }
39 } 39 }
40 } 40 }
41 41
42 InternalInputDeviceListX11::~InternalInputDeviceListX11() { 42 InternalInputDeviceListX11::~InternalInputDeviceListX11() {
43 } 43 }
44 44
45 bool InternalInputDeviceListX11::IsEventFromInternalDevice( 45 bool InternalInputDeviceListX11::IsEventFromInternalDevice(
46 const ui::Event* event) { 46 const ui::Event* event) {
47 if (!event->HasNativeEvent()) 47 // Key events are currently not XI2 events so we can't check the source device
48 // id and assume not internal.
49 if (event->IsKeyEvent() || !event->HasNativeEvent())
48 return false; 50 return false;
49 XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>( 51 XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(
sadrul 2014/05/23 17:21:57 CHECK that event->native_event()->type == GenericE
sadrul 2014/05/23 17:22:34 s/CHECK/Check/, as in, early return if not Generic
flackr 2014/05/23 17:30:28 Done.
50 event->native_event()->xcookie.data); 52 event->native_event()->xcookie.data);
51 return internal_device_ids_.find(xiev->sourceid) != 53 return internal_device_ids_.find(xiev->sourceid) !=
52 internal_device_ids_.end(); 54 internal_device_ids_.end();
53 } 55 }
54 56
55 } // namespace ash 57 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698