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 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ | 6 #define CONTENT_CHILD_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ |
7 | 7 |
8 #include "third_party/npapi/bindings/npapi.h" | 8 #include "third_party/npapi/bindings/npapi.h" |
9 | 9 |
10 namespace WebKit { | 10 namespace WebKit { |
11 class WebInputEvent; | 11 class WebInputEvent; |
12 class WebKeyboardEvent; | 12 class WebKeyboardEvent; |
13 class WebMouseEvent; | 13 class WebMouseEvent; |
14 class WebMouseWheelEvent; | 14 class WebMouseWheelEvent; |
15 } | 15 } |
16 | 16 |
17 namespace webkit { | 17 namespace content { |
18 namespace npapi { | |
19 | 18 |
20 // Utility class to translating WebInputEvent structs to equivalent structures | 19 // Utility class to translating WebInputEvent structs to equivalent structures |
21 // suitable for sending to Mac plugins (via NPP_HandleEvent). | 20 // suitable for sending to Mac plugins (via NPP_HandleEvent). |
22 class PluginWebEventConverter { | 21 class PluginWebEventConverter { |
23 public: | 22 public: |
24 PluginWebEventConverter(); | 23 PluginWebEventConverter(); |
25 virtual ~PluginWebEventConverter(); | 24 virtual ~PluginWebEventConverter(); |
26 | 25 |
27 // Initializes a converter for the given web event. Returns false if the event | 26 // Initializes a converter for the given web event. Returns false if the event |
28 // could not be converted. | 27 // could not be converted. |
(...skipping 14 matching lines...) Expand all Loading... |
43 bool ConvertMouseWheelEvent(const WebKit::WebMouseWheelEvent& web_event); | 42 bool ConvertMouseWheelEvent(const WebKit::WebMouseWheelEvent& web_event); |
44 | 43 |
45 // Returns the Cocoa translation of web_event's modifiers. | 44 // Returns the Cocoa translation of web_event's modifiers. |
46 static NSUInteger CocoaModifiers(const WebKit::WebInputEvent& web_event); | 45 static NSUInteger CocoaModifiers(const WebKit::WebInputEvent& web_event); |
47 | 46 |
48 NPCocoaEvent cocoa_event_; | 47 NPCocoaEvent cocoa_event_; |
49 | 48 |
50 DISALLOW_COPY_AND_ASSIGN(PluginWebEventConverter); | 49 DISALLOW_COPY_AND_ASSIGN(PluginWebEventConverter); |
51 }; | 50 }; |
52 | 51 |
53 } // namespace npapi | 52 } // namespace content |
54 } // namespace webkit | |
55 | 53 |
56 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ | 54 #endif // CONTENT_CHILD_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ |
OLD | NEW |