| Index: content/child/npapi/plugin_instance_mac.mm
|
| diff --git a/content/child/npapi/plugin_instance_mac.mm b/content/child/npapi/plugin_instance_mac.mm
|
| index 5453f8f6a56dee70ebb71331802b7be2507c0fe4..bc8edb2295bb0149738f7e1cb03a817152832c00 100644
|
| --- a/content/child/npapi/plugin_instance_mac.mm
|
| +++ b/content/child/npapi/plugin_instance_mac.mm
|
| @@ -19,56 +19,6 @@
|
|
|
| namespace content {
|
|
|
| -namespace {
|
| -
|
| -// Returns an autoreleased NSEvent constructed from the given np_event,
|
| -// targeting the given window.
|
| -NSEvent* NSEventForNPCocoaEvent(NPCocoaEvent* np_event, NSWindow* window) {
|
| - bool mouse_down = 1;
|
| - switch (np_event->type) {
|
| - case NPCocoaEventMouseDown:
|
| - mouse_down = 1;
|
| - break;
|
| - case NPCocoaEventMouseUp:
|
| - mouse_down = 0;
|
| - break;
|
| - default:
|
| - // If plugins start bringing up context menus for things other than
|
| - // clicks, this will need more plumbing; for now just log it and proceed
|
| - // as if it were a mouse down.
|
| - NOTREACHED();
|
| - }
|
| - NSEventType event_type = NSLeftMouseDown;
|
| - switch (np_event->data.mouse.buttonNumber) {
|
| - case 0:
|
| - event_type = mouse_down ? NSLeftMouseDown : NSLeftMouseUp;
|
| - break;
|
| - case 1:
|
| - event_type = mouse_down ? NSRightMouseDown : NSRightMouseUp;
|
| - break;
|
| - default:
|
| - event_type = mouse_down ? NSOtherMouseDown : NSOtherMouseUp;
|
| - break;
|
| - }
|
| -
|
| - NSInteger click_count = np_event->data.mouse.clickCount;
|
| - NSInteger modifiers = np_event->data.mouse.modifierFlags;
|
| - // NPCocoaEvent doesn't have a timestamp, so just use the current time.
|
| - NSEvent* event =
|
| - [NSEvent mouseEventWithType:event_type
|
| - location:NSZeroPoint
|
| - modifierFlags:modifiers
|
| - timestamp:[[NSApp currentEvent] timestamp]
|
| - windowNumber:[window windowNumber]
|
| - context:[NSGraphicsContext currentContext]
|
| - eventNumber:0
|
| - clickCount:click_count
|
| - pressure:1.0];
|
| - return event;
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| NPError PluginInstance::PopUpContextMenu(NPMenu* menu) {
|
| if (!currently_handled_event_)
|
| return NPERR_GENERIC_ERROR;
|
|
|