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

Side by Side Diff: content/child/npapi/plugin_web_event_converter_mac.h

Issue 1851093005: Remove content/child/npapi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_combined_01_02
Patch Set: rebase Created 4 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_CHILD_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_
6 #define CONTENT_CHILD_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_
7
8 #include "base/macros.h"
9 #include "third_party/npapi/bindings/npapi.h"
10
11 namespace blink {
12 class WebInputEvent;
13 class WebKeyboardEvent;
14 class WebMouseEvent;
15 class WebMouseWheelEvent;
16 }
17
18 namespace content {
19
20 // Utility class to translating WebInputEvent structs to equivalent structures
21 // suitable for sending to Mac plugins (via NPP_HandleEvent).
22 class PluginWebEventConverter {
23 public:
24 PluginWebEventConverter();
25 virtual ~PluginWebEventConverter();
26
27 // Initializes a converter for the given web event. Returns false if the event
28 // could not be converted.
29 bool InitWithEvent(const blink::WebInputEvent& web_event);
30
31 // Returns a pointer to a plugin event--suitable for passing to
32 // NPP_HandleEvent--corresponding to the the web event this converter was
33 // created with. The pointer is valid only as long as this object is.
34 // Returns NULL iff InitWithEvent returned false.
35 NPCocoaEvent* plugin_event() { return &cocoa_event_; }
36
37 private:
38 // Stores a converted plugin representation of the given web event, suitable
39 // for returning from plugin_event.
40 // Returns true if the event was successfully converted.
41 bool ConvertKeyboardEvent(const blink::WebKeyboardEvent& web_event);
42 bool ConvertMouseEvent(const blink::WebMouseEvent& web_event);
43 bool ConvertMouseWheelEvent(const blink::WebMouseWheelEvent& web_event);
44
45 // Returns the Cocoa translation of web_event's modifiers.
46 static NSUInteger CocoaModifiers(const blink::WebInputEvent& web_event);
47
48 NPCocoaEvent cocoa_event_;
49
50 DISALLOW_COPY_AND_ASSIGN(PluginWebEventConverter);
51 };
52
53 } // namespace content
54
55 #endif // CONTENT_CHILD_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_lib_unittest.cc ('k') | content/child/npapi/plugin_web_event_converter_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698