OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/child/npapi/plugin_host.h" | 5 #include "content/child/npapi/plugin_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 rv = NPERR_NO_ERROR; | 735 rv = NPERR_NO_ERROR; |
736 break; | 736 break; |
737 } | 737 } |
738 #endif | 738 #endif |
739 case NPNVjavascriptEnabledBool: { | 739 case NPNVjavascriptEnabledBool: { |
740 // yes, JS is enabled. | 740 // yes, JS is enabled. |
741 *((void**)value) = (void*)1; | 741 *((void**)value) = (void*)1; |
742 rv = NPERR_NO_ERROR; | 742 rv = NPERR_NO_ERROR; |
743 break; | 743 break; |
744 } | 744 } |
745 #if defined(TOOLKIT_GTK) | |
746 case NPNVToolkit: | |
747 // Tell them we are GTK2. (The alternative is GTK 1.2.) | |
748 *reinterpret_cast<int*>(value) = NPNVGtk2; | |
749 rv = NPERR_NO_ERROR; | |
750 break; | |
751 | |
752 case NPNVSupportsXEmbedBool: | |
753 *reinterpret_cast<NPBool*>(value) = true; | |
754 rv = NPERR_NO_ERROR; | |
755 break; | |
756 #endif | |
757 case NPNVSupportsWindowless: { | 745 case NPNVSupportsWindowless: { |
758 NPBool* supports_windowless = reinterpret_cast<NPBool*>(value); | 746 NPBool* supports_windowless = reinterpret_cast<NPBool*>(value); |
759 *supports_windowless = true; | 747 *supports_windowless = true; |
760 rv = NPERR_NO_ERROR; | 748 rv = NPERR_NO_ERROR; |
761 break; | 749 break; |
762 } | 750 } |
763 case NPNVprivateModeBool: { | 751 case NPNVprivateModeBool: { |
764 NPBool* private_mode = reinterpret_cast<NPBool*>(value); | 752 NPBool* private_mode = reinterpret_cast<NPBool*>(value); |
765 scoped_refptr<PluginInstance> plugin(FindInstance(id)); | 753 scoped_refptr<PluginInstance> plugin(FindInstance(id)); |
766 if (!plugin.get()) { | 754 if (!plugin.get()) { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 } | 1094 } |
1107 | 1095 |
1108 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { | 1096 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { |
1109 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); | 1097 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); |
1110 if (plugin.get()) { | 1098 if (plugin.get()) { |
1111 plugin->URLRedirectResponse(!!allow, notify_data); | 1099 plugin->URLRedirectResponse(!!allow, notify_data); |
1112 } | 1100 } |
1113 } | 1101 } |
1114 | 1102 |
1115 } // extern "C" | 1103 } // extern "C" |
OLD | NEW |