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

Side by Side Diff: content/browser/renderer_host/ui_events_helper.cc

Issue 23890039: Do not rewrite AltGr Key as Alt+Ctrl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove HTML file Created 7 years, 3 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/ui_events_helper.h" 5 #include "content/browser/renderer_host/ui_events_helper.h"
6 6
7 #include "third_party/WebKit/public/web/WebInputEvent.h" 7 #include "third_party/WebKit/public/web/WebInputEvent.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/event_constants.h" 9 #include "ui/events/event_constants.h"
10 10
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 gesture_event.sourceDevice = WebKit::WebGestureEvent::Touchscreen; 231 gesture_event.sourceDevice = WebKit::WebGestureEvent::Touchscreen;
232 gesture_event.modifiers = EventFlagsToWebEventModifiers(event.flags()); 232 gesture_event.modifiers = EventFlagsToWebEventModifiers(event.flags());
233 gesture_event.timeStampSeconds = event.time_stamp().InSecondsF(); 233 gesture_event.timeStampSeconds = event.time_stamp().InSecondsF();
234 234
235 return gesture_event; 235 return gesture_event;
236 } 236 }
237 237
238 int EventFlagsToWebEventModifiers(int flags) { 238 int EventFlagsToWebEventModifiers(int flags) {
239 int modifiers = 0; 239 int modifiers = 0;
240 240
241 // Translate AltGr modifier to Ctrl+Alt first.
242 if (flags & ui::EF_ALTGR_DOWN) {
243 modifiers |= WebKit::WebInputEvent::ControlKey |
244 WebKit::WebInputEvent::AltKey;
245 }
246 if (flags & ui::EF_SHIFT_DOWN) 241 if (flags & ui::EF_SHIFT_DOWN)
247 modifiers |= WebKit::WebInputEvent::ShiftKey; 242 modifiers |= WebKit::WebInputEvent::ShiftKey;
248 if (flags & ui::EF_CONTROL_DOWN) 243 if (flags & ui::EF_CONTROL_DOWN)
249 modifiers |= WebKit::WebInputEvent::ControlKey; 244 modifiers |= WebKit::WebInputEvent::ControlKey;
250 if (flags & ui::EF_ALT_DOWN) 245 if (flags & ui::EF_ALT_DOWN)
251 modifiers |= WebKit::WebInputEvent::AltKey; 246 modifiers |= WebKit::WebInputEvent::AltKey;
252 // TODO(beng): MetaKey/META_MASK 247 // TODO(beng): MetaKey/META_MASK
253 if (flags & ui::EF_LEFT_MOUSE_BUTTON) 248 if (flags & ui::EF_LEFT_MOUSE_BUTTON)
254 modifiers |= WebKit::WebInputEvent::LeftButtonDown; 249 modifiers |= WebKit::WebInputEvent::LeftButtonDown;
255 if (flags & ui::EF_MIDDLE_MOUSE_BUTTON) 250 if (flags & ui::EF_MIDDLE_MOUSE_BUTTON)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 322
328 // Update the type of the touch event. 323 // Update the type of the touch event.
329 web_event->type = TouchEventTypeFromEvent(event); 324 web_event->type = TouchEventTypeFromEvent(event);
330 web_event->timeStampSeconds = event.time_stamp().InSecondsF(); 325 web_event->timeStampSeconds = event.time_stamp().InSecondsF();
331 web_event->modifiers = EventFlagsToWebEventModifiers(event.flags()); 326 web_event->modifiers = EventFlagsToWebEventModifiers(event.flags());
332 327
333 return point; 328 return point;
334 } 329 }
335 330
336 } // namespace content 331 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698