| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 nppfuncs->newp = &CreatePlugin; | 910 nppfuncs->newp = &CreatePlugin; |
| 911 nppfuncs->destroy = &DestroyPlugin; | 911 nppfuncs->destroy = &DestroyPlugin; |
| 912 nppfuncs->getvalue = &GetValue; | 912 nppfuncs->getvalue = &GetValue; |
| 913 nppfuncs->event = &HandleEvent; | 913 nppfuncs->event = &HandleEvent; |
| 914 nppfuncs->setwindow = &SetWindow; | 914 nppfuncs->setwindow = &SetWindow; |
| 915 | 915 |
| 916 return NPERR_NO_ERROR; | 916 return NPERR_NO_ERROR; |
| 917 } | 917 } |
| 918 | 918 |
| 919 OSCALL NPError NP_Initialize(NPNetscapeFuncs* npnetscape_funcs | 919 OSCALL NPError NP_Initialize(NPNetscapeFuncs* npnetscape_funcs |
| 920 #if defined(OS_LINUX) | 920 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 921 , NPPluginFuncs* nppfuncs | 921 , NPPluginFuncs* nppfuncs |
| 922 #endif // OS_LINUX | 922 #endif |
| 923 ) { | 923 ) { |
| 924 LOG(INFO) << "NP_Initialize"; | 924 LOG(INFO) << "NP_Initialize"; |
| 925 if(npnetscape_funcs == NULL) | 925 if(npnetscape_funcs == NULL) |
| 926 return NPERR_INVALID_FUNCTABLE_ERROR; | 926 return NPERR_INVALID_FUNCTABLE_ERROR; |
| 927 | 927 |
| 928 if(((npnetscape_funcs->version & 0xff00) >> 8) > NP_VERSION_MAJOR) | 928 if(((npnetscape_funcs->version & 0xff00) >> 8) > NP_VERSION_MAJOR) |
| 929 return NPERR_INCOMPATIBLE_VERSION_ERROR; | 929 return NPERR_INCOMPATIBLE_VERSION_ERROR; |
| 930 | 930 |
| 931 g_npnetscape_funcs = npnetscape_funcs; | 931 g_npnetscape_funcs = npnetscape_funcs; |
| 932 #if defined(OS_LINUX) | 932 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 933 NP_GetEntryPoints(nppfuncs); | 933 NP_GetEntryPoints(nppfuncs); |
| 934 #endif // OS_LINUX | 934 #endif |
| 935 return NPERR_NO_ERROR; | 935 return NPERR_NO_ERROR; |
| 936 } | 936 } |
| 937 | 937 |
| 938 OSCALL NPError NP_Shutdown() { | 938 OSCALL NPError NP_Shutdown() { |
| 939 LOG(INFO) << "NP_Shutdown"; | 939 LOG(INFO) << "NP_Shutdown"; |
| 940 return NPERR_NO_ERROR; | 940 return NPERR_NO_ERROR; |
| 941 } | 941 } |
| 942 | 942 |
| 943 OSCALL const char* NP_GetMIMEDescription(void) { | 943 OSCALL const char* NP_GetMIMEDescription(void) { |
| 944 LOG(INFO) << "NP_GetMIMEDescription"; | 944 LOG(INFO) << "NP_GetMIMEDescription"; |
| 945 return STRINGIZE(HOST_PLUGIN_MIME_TYPE) ":" | 945 return STRINGIZE(HOST_PLUGIN_MIME_TYPE) ":" |
| 946 HOST_PLUGIN_NAME ":" | 946 HOST_PLUGIN_NAME ":" |
| 947 HOST_PLUGIN_DESCRIPTION; | 947 HOST_PLUGIN_DESCRIPTION; |
| 948 } | 948 } |
| 949 | 949 |
| 950 OSCALL NPError NP_GetValue(void* npp, NPPVariable variable, void* value) { | 950 OSCALL NPError NP_GetValue(void* npp, NPPVariable variable, void* value) { |
| 951 return GetValue((NPP)npp, variable, value); | 951 return GetValue((NPP)npp, variable, value); |
| 952 } | 952 } |
| 953 | 953 |
| 954 } // extern "C" | 954 } // extern "C" |
| OLD | NEW |