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

Side by Side Diff: chrome/browser/chromeos/events/event_rewriter.cc

Issue 270633012: Add native X11 testing to chromeos::EventRewriter unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for supported keycode for final native test 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/events/event_rewriter_unittest.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 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 "chrome/browser/chromeos/events/event_rewriter.h" 5 #include "chrome/browser/chromeos/events/event_rewriter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/wm/window_state.h" 9 #include "ash/wm/window_state.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void UpdateX11EventMask(int ui_flags, unsigned int* x_flags) { 130 void UpdateX11EventMask(int ui_flags, unsigned int* x_flags) {
131 static struct { 131 static struct {
132 int ui; 132 int ui;
133 int x; 133 int x;
134 } flags[] = { 134 } flags[] = {
135 {ui::EF_CONTROL_DOWN, ControlMask}, 135 {ui::EF_CONTROL_DOWN, ControlMask},
136 {ui::EF_SHIFT_DOWN, ShiftMask}, 136 {ui::EF_SHIFT_DOWN, ShiftMask},
137 {ui::EF_ALT_DOWN, Mod1Mask}, 137 {ui::EF_ALT_DOWN, Mod1Mask},
138 {ui::EF_CAPS_LOCK_DOWN, LockMask}, 138 {ui::EF_CAPS_LOCK_DOWN, LockMask},
139 {ui::EF_ALTGR_DOWN, Mod5Mask}, 139 {ui::EF_ALTGR_DOWN, Mod5Mask},
140 {ui::EF_COMMAND_DOWN, Mod4Mask},
140 {ui::EF_MOD3_DOWN, Mod3Mask}, 141 {ui::EF_MOD3_DOWN, Mod3Mask},
141 {ui::EF_NUMPAD_KEY, Mod2Mask}, 142 {ui::EF_NUMPAD_KEY, Mod2Mask},
142 {ui::EF_LEFT_MOUSE_BUTTON, Button1Mask}, 143 {ui::EF_LEFT_MOUSE_BUTTON, Button1Mask},
143 {ui::EF_MIDDLE_MOUSE_BUTTON, Button2Mask}, 144 {ui::EF_MIDDLE_MOUSE_BUTTON, Button2Mask},
144 {ui::EF_RIGHT_MOUSE_BUTTON, Button3Mask}, 145 {ui::EF_RIGHT_MOUSE_BUTTON, Button3Mask},
145 }; 146 };
146 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(flags); ++i) { 147 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(flags); ++i) {
147 if (ui_flags & flags[i].ui) 148 if (ui_flags & flags[i].ui)
148 *x_flags |= flags[i].x; 149 *x_flags |= flags[i].x;
149 else 150 else
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 758
758 XIFreeDeviceInfo(device_info); 759 XIFreeDeviceInfo(device_info);
759 } 760 }
760 761
761 void EventRewriter::DeviceRemoved(int device_id) { 762 void EventRewriter::DeviceRemoved(int device_id) {
762 device_id_to_type_.erase(device_id); 763 device_id_to_type_.erase(device_id);
763 } 764 }
764 #endif 765 #endif
765 766
766 } // namespace chromeos 767 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/events/event_rewriter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698