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

Unified Diff: content/child/npapi/plugin_instance_mac.mm

Issue 63153003: mac: Prepare for -Wunused-functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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
« no previous file with comments | « content/child/indexed_db/indexed_db_dispatcher.cc ('k') | content/child/site_isolation_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/child/indexed_db/indexed_db_dispatcher.cc ('k') | content/child/site_isolation_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698