OLD | NEW |
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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/child/npapi/plugin_web_event_converter_mac.h" | 8 #include "content/child/npapi/plugin_web_event_converter_mac.h" |
9 #include "third_party/WebKit/public/web/WebInputEvent.h" | 9 #include "third_party/WebKit/public/web/WebInputEvent.h" |
10 | 10 |
11 using WebKit::WebInputEvent; | 11 using blink::WebInputEvent; |
12 using WebKit::WebKeyboardEvent; | 12 using blink::WebKeyboardEvent; |
13 using WebKit::WebMouseEvent; | 13 using blink::WebMouseEvent; |
14 using WebKit::WebMouseWheelEvent; | 14 using blink::WebMouseWheelEvent; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Returns true if the given key is a modifier key. | 20 // Returns true if the given key is a modifier key. |
21 bool KeyIsModifier(int native_key_code) { | 21 bool KeyIsModifier(int native_key_code) { |
22 switch (native_key_code) { | 22 switch (native_key_code) { |
23 case 55: // Left command | 23 case 55: // Left command |
24 case 54: // Right command | 24 case 54: // Right command |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 if (web_event.modifiers & WebInputEvent::AltKey) | 179 if (web_event.modifiers & WebInputEvent::AltKey) |
180 modifiers |= NSAlternateKeyMask; | 180 modifiers |= NSAlternateKeyMask; |
181 if (web_event.modifiers & WebInputEvent::MetaKey) | 181 if (web_event.modifiers & WebInputEvent::MetaKey) |
182 modifiers |= NSCommandKeyMask; | 182 modifiers |= NSCommandKeyMask; |
183 if (CapsLockIsActive(web_event)) | 183 if (CapsLockIsActive(web_event)) |
184 modifiers |= NSAlphaShiftKeyMask; | 184 modifiers |= NSAlphaShiftKeyMask; |
185 return modifiers; | 185 return modifiers; |
186 } | 186 } |
187 | 187 |
188 } // namespace content | 188 } // namespace content |
OLD | NEW |