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

Unified Diff: webkit/plugins/npapi/plugin_web_event_converter_mac.h

Issue 10928072: Remove all support for the Carbon NPAPI event model (Closed) Base URL: http://git.chromium.org/chromium/src.git@test-plugin-cocoa
Patch Set: Rebase Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/npapi/plugin_web_event_converter_mac.h
diff --git a/webkit/plugins/npapi/plugin_web_event_converter_mac.h b/webkit/plugins/npapi/plugin_web_event_converter_mac.h
index a525428e2b2c44f357058b8d0f90b48b2bbf4c4f..47a8e4917b74c73876d158f46161973844e06167 100644
--- a/webkit/plugins/npapi/plugin_web_event_converter_mac.h
+++ b/webkit/plugins/npapi/plugin_web_event_converter_mac.h
@@ -21,43 +21,33 @@ namespace npapi {
// suitable for sending to Mac plugins (via NPP_HandleEvent).
class PluginWebEventConverter {
public:
- PluginWebEventConverter() {}
- virtual ~PluginWebEventConverter() {}
+ PluginWebEventConverter();
+ virtual ~PluginWebEventConverter();
// Initializes a converter for the given web event. Returns false if the event
// could not be converted.
- virtual bool InitWithEvent(const WebKit::WebInputEvent& web_event);
+ bool InitWithEvent(const WebKit::WebInputEvent& web_event);
// Returns a pointer to a plugin event--suitable for passing to
// NPP_HandleEvent--corresponding to the the web event this converter was
// created with. The pointer is valid only as long as this object is.
// Returns NULL iff InitWithEvent returned false.
- virtual void* plugin_event() = 0;
+ NPCocoaEvent* plugin_event() { return &cocoa_event_; }
- protected:
- // To be overridden by subclasses to store a converted plugin representation
- // of the given web event, suitable for returning from plugin_event.
+ private:
+ // Stores a converted plugin representation of the given web event, suitable
+ // for returning from plugin_event.
// Returns true if the event was successfully converted.
- virtual bool ConvertKeyboardEvent(
- const WebKit::WebKeyboardEvent& web_event) = 0;
- virtual bool ConvertMouseEvent(const WebKit::WebMouseEvent& web_event) = 0;
- virtual bool ConvertMouseWheelEvent(
- const WebKit::WebMouseWheelEvent& web_event) = 0;
+ bool ConvertKeyboardEvent(const WebKit::WebKeyboardEvent& web_event);
+ bool ConvertMouseEvent(const WebKit::WebMouseEvent& web_event);
+ bool ConvertMouseWheelEvent(const WebKit::WebMouseWheelEvent& web_event);
- private:
- DISALLOW_COPY_AND_ASSIGN(PluginWebEventConverter);
-};
+ // Returns the Cocoa translation of web_event's modifiers.
+ static NSUInteger CocoaModifiers(const WebKit::WebInputEvent& web_event);
-// Factory for generating PluginWebEventConverter objects by event model.
-class PluginWebEventConverterFactory {
- public:
- // Returns a new PluginWebEventConverter corresponding to the given plugin
- // event model.
- static PluginWebEventConverter*
- CreateConverterForModel(NPEventModel event_model);
+ NPCocoaEvent cocoa_event_;
- private:
- DISALLOW_COPY_AND_ASSIGN(PluginWebEventConverterFactory);
+ DISALLOW_COPY_AND_ASSIGN(PluginWebEventConverter);
};
} // namespace npapi
« no previous file with comments | « webkit/plugins/npapi/carbon_plugin_window_tracker_mac.cc ('k') | webkit/plugins/npapi/plugin_web_event_converter_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698