| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/plugin_web_event_converter_mac.h" | 8 #include "webkit/plugins/npapi/plugin_web_event_converter_mac.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
| 10 | 10 |
| 11 using WebKit::WebInputEvent; | 11 using WebKit::WebInputEvent; |
| 12 using WebKit::WebKeyboardEvent; | 12 using WebKit::WebKeyboardEvent; |
| 13 using WebKit::WebMouseEvent; | 13 using WebKit::WebMouseEvent; |
| 14 using WebKit::WebMouseWheelEvent; | 14 using WebKit::WebMouseWheelEvent; |
| 15 | 15 |
| 16 namespace webkit { |
| 17 namespace npapi { |
| 18 |
| 16 namespace { | 19 namespace { |
| 17 | 20 |
| 18 // Returns true if the caps lock flag should be set for the given event. | 21 // Returns true if the caps lock flag should be set for the given event. |
| 19 bool CapsLockIsActive(const WebInputEvent& event) { | 22 bool CapsLockIsActive(const WebInputEvent& event) { |
| 20 // Only key events have accurate information for the caps lock flag; see | 23 // Only key events have accurate information for the caps lock flag; see |
| 21 // <https://bugs.webkit.org/show_bug.cgi?id=46518>. | 24 // <https://bugs.webkit.org/show_bug.cgi?id=46518>. |
| 22 // For other types, use the live state. | 25 // For other types, use the live state. |
| 23 if (WebInputEvent::isKeyboardEventType(event.type)) | 26 if (WebInputEvent::isKeyboardEventType(event.type)) |
| 24 return (event.modifiers & WebInputEvent::CapsLockOn) != 0; | 27 return (event.modifiers & WebInputEvent::CapsLockOn) != 0; |
| 25 else | 28 else |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 return new CocoaPluginWebEventConverter(); | 353 return new CocoaPluginWebEventConverter(); |
| 351 #ifndef NP_NO_CARBON | 354 #ifndef NP_NO_CARBON |
| 352 case NPEventModelCarbon: | 355 case NPEventModelCarbon: |
| 353 return new CarbonPluginWebEventConverter(); | 356 return new CarbonPluginWebEventConverter(); |
| 354 #endif | 357 #endif |
| 355 default: | 358 default: |
| 356 NOTIMPLEMENTED(); | 359 NOTIMPLEMENTED(); |
| 357 return NULL; | 360 return NULL; |
| 358 } | 361 } |
| 359 } | 362 } |
| 363 |
| 364 } // namespace npapi |
| 365 } // namespace webkit |
| OLD | NEW |