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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_util.cc

Issue 1559163002: Clean up event flags a bit: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 4 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // MSVC++ requires this to be set before any other includes to get M_PI. 5 // MSVC++ requires this to be set before any other includes to get M_PI.
6 #define _USE_MATH_DEFINES 6 #define _USE_MATH_DEFINES
7 7
8 #include "content/browser/renderer_host/input/web_input_event_util.h" 8 #include "content/browser/renderer_host/input/web_input_event_util.h"
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 19 matching lines...) Expand all
30 int flags = 0; 30 int flags = 0;
31 31
32 if (modifiers & blink::WebInputEvent::ShiftKey) 32 if (modifiers & blink::WebInputEvent::ShiftKey)
33 flags |= ui::EF_SHIFT_DOWN; 33 flags |= ui::EF_SHIFT_DOWN;
34 if (modifiers & blink::WebInputEvent::ControlKey) 34 if (modifiers & blink::WebInputEvent::ControlKey)
35 flags |= ui::EF_CONTROL_DOWN; 35 flags |= ui::EF_CONTROL_DOWN;
36 if (modifiers & blink::WebInputEvent::AltKey) 36 if (modifiers & blink::WebInputEvent::AltKey)
37 flags |= ui::EF_ALT_DOWN; 37 flags |= ui::EF_ALT_DOWN;
38 if (modifiers & blink::WebInputEvent::MetaKey) 38 if (modifiers & blink::WebInputEvent::MetaKey)
39 flags |= ui::EF_COMMAND_DOWN; 39 flags |= ui::EF_COMMAND_DOWN;
40 40 if (modifiers & blink::WebInputEvent::CapsLockOn)
41 flags |= ui::EF_CAPS_LOCK_ON;
42 if (modifiers & blink::WebInputEvent::NumLockOn)
43 flags |= ui::EF_NUM_LOCK_ON;
44 if (modifiers & blink::WebInputEvent::ScrollLockOn)
45 flags |= ui::EF_SCROLL_LOCK_ON;
41 if (modifiers & blink::WebInputEvent::LeftButtonDown) 46 if (modifiers & blink::WebInputEvent::LeftButtonDown)
42 flags |= ui::EF_LEFT_MOUSE_BUTTON; 47 flags |= ui::EF_LEFT_MOUSE_BUTTON;
43 if (modifiers & blink::WebInputEvent::MiddleButtonDown) 48 if (modifiers & blink::WebInputEvent::MiddleButtonDown)
44 flags |= ui::EF_MIDDLE_MOUSE_BUTTON; 49 flags |= ui::EF_MIDDLE_MOUSE_BUTTON;
45 if (modifiers & blink::WebInputEvent::RightButtonDown) 50 if (modifiers & blink::WebInputEvent::RightButtonDown)
46 flags |= ui::EF_RIGHT_MOUSE_BUTTON; 51 flags |= ui::EF_RIGHT_MOUSE_BUTTON;
47 if (modifiers & blink::WebInputEvent::CapsLockOn)
48 flags |= ui::EF_CAPS_LOCK_DOWN;
49 if (modifiers & blink::WebInputEvent::NumLockOn)
50 flags |= ui::EF_NUM_LOCK_DOWN;
51 if (modifiers & blink::WebInputEvent::ScrollLockOn)
52 flags |= ui::EF_SCROLL_LOCK_DOWN;
53 if (modifiers & blink::WebInputEvent::IsAutoRepeat) 52 if (modifiers & blink::WebInputEvent::IsAutoRepeat)
54 flags |= ui::EF_IS_REPEAT; 53 flags |= ui::EF_IS_REPEAT;
55 54
56 return flags; 55 return flags;
57 } 56 }
58 57
59 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers( 58 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers(
60 ui::DomCode code) { 59 ui::DomCode code) {
61 switch (ui::KeycodeConverter::DomCodeToLocation(code)) { 60 switch (ui::KeycodeConverter::DomCodeToLocation(code)) {
62 case ui::DomKeyLocation::LEFT: 61 case ui::DomKeyLocation::LEFT:
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 170
172 // TODO(oshima): Find out if ContextMenu needs to be scaled. 171 // TODO(oshima): Find out if ContextMenu needs to be scaled.
173 default: 172 default:
174 break; 173 break;
175 } 174 }
176 } 175 }
177 return scaled_event; 176 return scaled_event;
178 } 177 }
179 178
180 } // namespace content 179 } // namespace content
OLDNEW
« no previous file with comments | « components/mus/ws/event_dispatcher_unittest.cc ('k') | mojo/converters/blink/blink_input_events_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698