| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // HACK: we need this #define in place before npapi.h is included for |
| 6 // plugins to work. However, all sorts of headers include npapi.h, so |
| 7 // the only way to be certain the define is in place is to put it |
| 8 // here. You might ask, "Why not set it in npapi.h directly, or in |
| 9 // this directory's SConscript, then?" but it turns out this define |
| 10 // makes npapi.h include Xlib.h, which in turn defines a ton of symbols |
| 11 // like None and Status, causing conflicts with the aforementioned |
| 12 // many headers that include npapi.h. Ugh. |
| 13 // See also webplugin_delegate_impl.cc. |
| 14 #define MOZ_X11 1 |
| 15 |
| 5 #include "config.h" | 16 #include "config.h" |
| 6 | 17 |
| 7 #include "webkit/glue/plugins/plugin_host.h" | 18 #include "webkit/glue/plugins/plugin_host.h" |
| 8 | 19 |
| 9 #include "base/file_util.h" | 20 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 21 #include "base/logging.h" |
| 11 #include "base/scoped_ptr.h" | 22 #include "base/scoped_ptr.h" |
| 12 #include "base/string_piece.h" | 23 #include "base/string_piece.h" |
| 13 #include "base/string_util.h" | 24 #include "base/string_util.h" |
| 14 #include "base/sys_string_conversions.h" | 25 #include "base/sys_string_conversions.h" |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 NPAPI::PluginInstance::GetInitializingInstance(); | 747 NPAPI::PluginInstance::GetInitializingInstance(); |
| 737 if (instance) { | 748 if (instance) { |
| 738 instance->GetServiceManager(reinterpret_cast<void**>(value)); | 749 instance->GetServiceManager(reinterpret_cast<void**>(value)); |
| 739 } else { | 750 } else { |
| 740 NOTREACHED(); | 751 NOTREACHED(); |
| 741 } | 752 } |
| 742 | 753 |
| 743 rv = NPERR_NO_ERROR; | 754 rv = NPERR_NO_ERROR; |
| 744 break; | 755 break; |
| 745 } | 756 } |
| 757 #if defined(OS_LINUX) |
| 758 case NPNVToolkit: |
| 759 // Tell them we are GTK2. (The alternative is GTK 1.2.) |
| 760 *reinterpret_cast<int*>(value) = NPNVGtk2; |
| 761 rv = NPERR_NO_ERROR; |
| 762 break; |
| 763 |
| 764 case NPNVSupportsXEmbedBool: |
| 765 // Yes, we support XEmbed. |
| 766 *reinterpret_cast<NPBool*>(value) = TRUE; |
| 767 rv = NPERR_NO_ERROR; |
| 768 break; |
| 769 #endif |
| 746 case NPNVSupportsWindowless: | 770 case NPNVSupportsWindowless: |
| 747 { | 771 { |
| 748 NPBool* supports_windowless = reinterpret_cast<NPBool*>(value); | 772 NPBool* supports_windowless = reinterpret_cast<NPBool*>(value); |
| 749 *supports_windowless = TRUE; | 773 *supports_windowless = TRUE; |
| 750 rv = NPERR_NO_ERROR; | 774 rv = NPERR_NO_ERROR; |
| 751 break; | 775 break; |
| 752 } | 776 } |
| 753 case default_plugin::kMissingPluginStatusStart + | 777 case default_plugin::kMissingPluginStatusStart + |
| 754 default_plugin::MISSING_PLUGIN_AVAILABLE: | 778 default_plugin::MISSING_PLUGIN_AVAILABLE: |
| 755 // fall through | 779 // fall through |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 void (*func)(void *), | 882 void (*func)(void *), |
| 859 void *userData) { | 883 void *userData) { |
| 860 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); | 884 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 861 if (plugin) { | 885 if (plugin) { |
| 862 plugin->PluginThreadAsyncCall(func, userData); | 886 plugin->PluginThreadAsyncCall(func, userData); |
| 863 } | 887 } |
| 864 } | 888 } |
| 865 | 889 |
| 866 } // extern "C" | 890 } // extern "C" |
| 867 | 891 |
| OLD | NEW |