OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Pepper API support should be turned on for this module. | |
6 #define PEPPER_APIS_ENABLED | |
7 | |
8 #include "webkit/glue/plugins/plugin_host.h" | 5 #include "webkit/glue/plugins/plugin_host.h" |
9 | 6 |
10 #include "base/file_util.h" | 7 #include "base/file_util.h" |
11 #include "base/logging.h" | 8 #include "base/logging.h" |
12 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
13 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
14 #include "base/string_util.h" | 11 #include "base/string_util.h" |
15 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
16 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
17 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } | 792 } |
796 case NPNVsupportsOpenGLBool: | 793 case NPNVsupportsOpenGLBool: |
797 case NPNVsupportsCoreAnimationBool: { | 794 case NPNVsupportsCoreAnimationBool: { |
798 // we do not support these drawing and event models. | 795 // we do not support these drawing and event models. |
799 NPBool* supports_model = reinterpret_cast<NPBool*>(value); | 796 NPBool* supports_model = reinterpret_cast<NPBool*>(value); |
800 *supports_model = FALSE; | 797 *supports_model = FALSE; |
801 rv = NPERR_NO_ERROR; | 798 rv = NPERR_NO_ERROR; |
802 break; | 799 break; |
803 } | 800 } |
804 #endif // OS_MACOSX | 801 #endif // OS_MACOSX |
805 case NPNVPepperExtensions: | 802 case NPNVPepperExtensions: { |
806 rv = NPAPI::GetPepperExtensionsFunctions(value); | 803 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 804 if (plugin->webplugin()->delegate() != NULL) { |
| 805 // Delegate is only set for in-renderer Pepper plugins. |
| 806 rv = NPAPI::GetPepperExtensionsFunctions(value); |
| 807 } else { |
| 808 rv = NPERR_GENERIC_ERROR; |
| 809 } |
807 break; | 810 break; |
| 811 } |
808 default: | 812 default: |
809 DLOG(INFO) << "NPN_GetValue(" << variable << ") is not implemented yet."; | 813 DLOG(INFO) << "NPN_GetValue(" << variable << ") is not implemented yet."; |
810 break; | 814 break; |
811 } | 815 } |
812 return rv; | 816 return rv; |
813 } | 817 } |
814 | 818 |
815 NPError NPN_SetValue(NPP id, NPPVariable variable, void* value) { | 819 NPError NPN_SetValue(NPP id, NPPVariable variable, void* value) { |
816 // Allows the plugin to set various modes | 820 // Allows the plugin to set various modes |
817 | 821 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 NPCoordinateSpace destSpace) { | 1055 NPCoordinateSpace destSpace) { |
1052 NOTIMPLEMENTED(); | 1056 NOTIMPLEMENTED(); |
1053 if (destX) | 1057 if (destX) |
1054 *destX = sourceX; | 1058 *destX = sourceX; |
1055 if (destY) | 1059 if (destY) |
1056 *destY = sourceY; | 1060 *destY = sourceY; |
1057 return FALSE; | 1061 return FALSE; |
1058 } | 1062 } |
1059 | 1063 |
1060 } // extern "C" | 1064 } // extern "C" |
OLD | NEW |