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

Unified Diff: nixysa/static_glue/npapi/main.cc

Issue 11131005: nixysa/mac: Use CG/Cocoa rendering model (Closed) Base URL: https://nixysa.googlecode.com/svn/trunk
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nixysa/static_glue/npapi/main.cc
diff --git a/nixysa/static_glue/npapi/main.cc b/nixysa/static_glue/npapi/main.cc
index 1511c97adf4f6c1022179c21e028ea09a3e2a726..8c563baa9023a7a4ad029464e2bcaa6ee147caf5 100644
--- a/nixysa/static_glue/npapi/main.cc
+++ b/nixysa/static_glue/npapi/main.cc
@@ -72,6 +72,30 @@ extern "C" {
glue::InitializeGlue(instance);
NPObject *object = glue::CreateStaticNPObject(instance);
instance->pdata = object;
+
+#if defined(OS_MACOSX)
+ // On the Mac, starting from Google Chrome 22, we need to negotiate
+ // CoreGraphics and Cocoa even though we don't use it.
+ // See: http://code.google.com/p/chromium/issues/detail?id=134761
+ // Code ported from http://gwt-code-reviews.appspot.com/1844803/
+
+ // Select the right drawing model if necessary
+ NPBool supports_core_graphics = false;
+ if (NPN_GetValue(instance, NPNVsupportsCoreGraphicsBool,
+ &supports_core_graphics) == NPERR_NO_ERROR &&
+ supports_core_graphics) {
+ NPN_SetValue(instance, NPPVpluginDrawingModel,
+ reinterpret_cast<void*>(NPDrawingModelCoreGraphics));
+ }
+ // Select the Cocoa event model
+ NPBool supports_cocoa_events = false;
+ if (NPN_GetValue(instance, NPNVsupportsCocoaBool,
+ &supports_cocoa_events) == NPERR_NO_ERROR &&
+ supports_cocoa_events) {
+ NPN_SetValue(instance, NPPVpluginEventModel,
+ reinterpret_cast<void*>(NPEventModelCocoa));
+ }
+#endif
return NPERR_NO_ERROR;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698