summaryrefslogtreecommitdiffstats
path: root/webkit/default_plugin
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 21:21:57 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 21:21:57 +0000
commit623d3ae5302a62c73cf6ad18245c76b481e5d4b0 (patch)
tree268a309256a6bec5f5539bdd594710ad756cefda /webkit/default_plugin
parent5e1bf5d1b59769cb09b36815c184a1bc5802bb36 (diff)
downloadchromium_src-623d3ae5302a62c73cf6ad18245c76b481e5d4b0.zip
chromium_src-623d3ae5302a62c73cf6ad18245c76b481e5d4b0.tar.gz
chromium_src-623d3ae5302a62c73cf6ad18245c76b481e5d4b0.tar.bz2
Revert 48315 - Linux: Initial scaffolding for default plugin.
Basically the linux version of http://codereview.chromium.org/2075006 BUG=10952 TEST=Go to http://www.adobe.com/shockwave/welcome/. The task manager should show that the default plugin is running, and the "Missing Plugin" text should look slightly different than it did before. Also, the plugin area is now grey instead of transparent. (this test depends on a small webkit shown below) Requires commenting out if (objectContentType(url, mimeType) != ObjectContentNetscapePlugin) return 0; in WebKit/WebKit/chromium/src/FrameLoaderClientImpl.cpp's createPlugin() as well, else the default plugin won't load. Review URL: http://codereview.chromium.org/2079016 TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/2291004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/default_plugin')
-rw-r--r--webkit/default_plugin/default_plugin.gyp111
-rw-r--r--webkit/default_plugin/plugin_impl_gtk.cc139
-rw-r--r--webkit/default_plugin/plugin_impl_gtk.h283
-rw-r--r--webkit/default_plugin/plugin_impl_mac.h9
-rw-r--r--webkit/default_plugin/plugin_impl_mac.mm8
-rw-r--r--webkit/default_plugin/plugin_impl_win.cc8
-rw-r--r--webkit/default_plugin/plugin_main.cc69
-rw-r--r--webkit/default_plugin/plugin_main.h7
8 files changed, 77 insertions, 557 deletions
diff --git a/webkit/default_plugin/default_plugin.gyp b/webkit/default_plugin/default_plugin.gyp
index 3128e72..c353ed9 100644
--- a/webkit/default_plugin/default_plugin.gyp
+++ b/webkit/default_plugin/default_plugin.gyp
@@ -7,63 +7,62 @@
'chromium_code': 1,
},
'targets': [
- {
- 'target_name': 'default_plugin',
- 'type': '<(library)',
- 'dependencies': [
- '../../net/net.gyp:net_resources',
- '../../third_party/icu/icu.gyp:icui18n',
- '../../third_party/icu/icu.gyp:icuuc',
- '../../third_party/libxml/libxml.gyp:libxml',
- '../../third_party/npapi/npapi.gyp:npapi',
- ],
- 'include_dirs': [
- '../..',
- '<(DEPTH)/third_party/wtl/include',
- # TODO(bradnelson): this should fall out of the dependencies.
- '<(SHARED_INTERMEDIATE_DIR)/webkit',
- ],
- 'sources': [
- 'default_plugin_shared.h',
- 'plugin_impl_gtk.cc',
- 'plugin_impl_gtk.h',
- 'plugin_impl_mac.h',
- 'plugin_impl_mac.mm',
- 'plugin_impl_win.cc',
- 'plugin_impl_win.h',
- 'plugin_main.cc',
- 'plugin_main.h',
- ],
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': [
- # TODO(thakis): These throw a CircularException on mac.
- # Figure out why once they're needed.
- '../support/webkit_support.gyp:webkit_resources',
- '../support/webkit_support.gyp:webkit_strings',
- ],
- 'msvs_guid': '5916D37D-8C97-424F-A904-74E52594C2D6',
- 'link_settings': {
- 'libraries': ['-lurlmon.lib'],
- },
- 'sources': [
- 'default_plugin.cc',
- 'default_plugin_resources.h',
- 'install_dialog.cc',
- 'install_dialog.h',
- 'plugin_database_handler.cc',
- 'plugin_database_handler.h',
- 'plugin_install_job_monitor.cc',
- 'plugin_install_job_monitor.h',
- ],
- }],
- ['OS=="linux"', {
- 'dependencies': [
- '../../build/linux/system.gyp:gtk',
- ],
- }],
+ ],
+ 'conditions': [
+ ['OS=="win" or OS=="mac"', {
+ 'targets': [
+ {
+ 'target_name': 'default_plugin',
+ 'type': '<(library)',
+ 'dependencies': [
+ '../../net/net.gyp:net_resources',
+ '../../third_party/icu/icu.gyp:icui18n',
+ '../../third_party/icu/icu.gyp:icuuc',
+ '../../third_party/libxml/libxml.gyp:libxml',
+ '../../third_party/npapi/npapi.gyp:npapi',
+ ],
+ 'include_dirs': [
+ '../..',
+ '<(DEPTH)/third_party/wtl/include',
+ # TODO(bradnelson): this should fall out of the dependencies.
+ '<(SHARED_INTERMEDIATE_DIR)/webkit',
+ ],
+ 'sources': [
+ 'default_plugin_shared.h',
+ 'plugin_impl_mac.h',
+ 'plugin_impl_mac.mm',
+ 'plugin_impl_win.cc',
+ 'plugin_impl_win.h',
+ 'plugin_main.cc',
+ 'plugin_main.h',
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': [
+ # TODO(thakis): These throw a CircularException on mac.
+ # Figure out why once they're needed.
+ '../support/webkit_support.gyp:webkit_resources',
+ '../support/webkit_support.gyp:webkit_strings',
+ ],
+ 'msvs_guid': '5916D37D-8C97-424F-A904-74E52594C2D6',
+ 'link_settings': {
+ 'libraries': ['-lurlmon.lib'],
+ },
+ 'sources': [
+ 'default_plugin.cc',
+ 'default_plugin_resources.h',
+ 'install_dialog.cc',
+ 'install_dialog.h',
+ 'plugin_database_handler.cc',
+ 'plugin_database_handler.h',
+ 'plugin_install_job_monitor.cc',
+ 'plugin_install_job_monitor.h',
+ ],
+ }],
+ ],
+ },
],
- },
+ }],
],
}
diff --git a/webkit/default_plugin/plugin_impl_gtk.cc b/webkit/default_plugin/plugin_impl_gtk.cc
deleted file mode 100644
index cfc599a..0000000
--- a/webkit/default_plugin/plugin_impl_gtk.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "webkit/default_plugin/plugin_impl_gtk.h"
-
-#include <gdk/gdkx.h>
-
-#include "base/file_util.h"
-#include "base/path_service.h"
-#include "base/string_util.h"
-#include "googleurl/src/gurl.h"
-#include "grit/webkit_strings.h"
-#include "unicode/locid.h"
-#include "webkit/default_plugin/default_plugin_shared.h"
-#include "webkit/default_plugin/plugin_main.h"
-#include "webkit/glue/webkit_glue.h"
-
-// TODO(thakis): Most methods in this class are stubbed out an need to be
-// implemented.
-
-PluginInstallerImpl::PluginInstallerImpl(int16 mode)
- : container_(NULL) {
-}
-
-PluginInstallerImpl::~PluginInstallerImpl() {
- if (container_)
- gtk_widget_destroy(container_);
-}
-
-bool PluginInstallerImpl::Initialize(void* module_handle, NPP instance,
- NPMIMEType mime_type, int16 argc,
- char* argn[], char* argv[]) {
- DLOG(INFO) << __FUNCTION__ << " MIME Type : " << mime_type;
- DCHECK(instance != NULL);
-
- if (mime_type == NULL || strlen(mime_type) == 0) {
- DLOG(WARNING) << __FUNCTION__ << " Invalid parameters passed in";
- NOTREACHED();
- return false;
- }
-
- instance_ = instance;
- mime_type_ = mime_type;
-
- return true;
-}
-
-bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) {
- if (container_)
- gtk_widget_destroy(container_);
- container_ = gtk_plug_new(reinterpret_cast<XID>(window_info->window));
-
- // Add label.
- GtkWidget* box = gtk_vbox_new(FALSE, 0);
- GtkWidget* label = gtk_label_new("Missing Plug-in");
- gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
- gtk_container_add(GTK_CONTAINER(container_), box);
-
- gtk_widget_show_all(container_);
-
- return true;
-}
-
-void PluginInstallerImpl::Shutdown() {
-}
-
-void PluginInstallerImpl::NewStream(NPStream* stream) {
- plugin_install_stream_ = stream;
-}
-
-void PluginInstallerImpl::DestroyStream(NPStream* stream, NPError reason) {
- if (stream == plugin_install_stream_)
- plugin_install_stream_ = NULL;
-}
-
-bool PluginInstallerImpl::WriteReady(NPStream* stream) {
- bool ready_to_accept_data = false;
- return ready_to_accept_data;
-}
-
-int32 PluginInstallerImpl::Write(NPStream* stream, int32 offset,
- int32 buffer_length, void* buffer) {
- return true;
-}
-
-void PluginInstallerImpl::ClearDisplay() {
-}
-
-void PluginInstallerImpl::RefreshDisplay() {
-}
-
-bool PluginInstallerImpl::CreateToolTip() {
- return true;
-}
-
-void PluginInstallerImpl::UpdateToolTip() {
-}
-
-void PluginInstallerImpl::DisplayAvailablePluginStatus() {
-}
-
-void PluginInstallerImpl::DisplayStatus(int message_resource_id) {
-}
-
-void PluginInstallerImpl::DisplayPluginDownloadFailedStatus() {
-}
-
-void PluginInstallerImpl::URLNotify(const char* url, NPReason reason) {
-}
-
-int16 PluginInstallerImpl::NPP_HandleEvent(void* event) {
- return 0;
-}
-
-std::wstring PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement(
- int message_id_with_placeholders,
- int messsage_id_without_placeholders,
- const std::wstring& replacement_string) {
- return L"";
-}
-
-void PluginInstallerImpl::DownloadPlugin() {
-}
-
-void PluginInstallerImpl::DownloadCancelled() {
- DisplayAvailablePluginStatus();
-}
-
-void PluginInstallerImpl::ShowInstallDialog() {
-}
-
-void PluginInstallerImpl::NotifyPluginStatus(int status) {
- default_plugin::g_browser->getvalue(
- instance_,
- static_cast<NPNVariable>(
- default_plugin::kMissingPluginStatusStart + status),
- NULL);
-}
diff --git a/webkit/default_plugin/plugin_impl_gtk.h b/webkit/default_plugin/plugin_impl_gtk.h
deleted file mode 100644
index 7e2113be..0000000
--- a/webkit/default_plugin/plugin_impl_gtk.h
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef WEBKIT_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_
-#define WEBKIT_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_
-
-#include <string>
-#include <vector>
-
-#include <gtk/gtk.h>
-
-#include "gfx/native_widget_types.h"
-#include "third_party/npapi/bindings/npapi.h"
-
-// Possible plugin installer states.
-enum PluginInstallerState {
- PluginInstallerStateUndefined,
- PluginListDownloadInitiated,
- PluginListDownloaded,
- PluginListDownloadedPluginNotFound,
- PluginListDownloadFailed,
- PluginDownloadInitiated,
- PluginDownloadCompleted,
- PluginDownloadFailed,
- PluginInstallerLaunchSuccess,
- PluginInstallerLaunchFailure
-};
-
-class PluginInstallDialog;
-class PluginDatabaseHandler;
-
-// Provides the plugin installation functionality. This class is
-// instantiated with the information like the mime type of the
-// target plugin, the display mode, etc.
-class PluginInstallerImpl {
- public:
- // mode is the plugin instantiation mode, i.e. whether it is a full
- // page plugin (NP_FULL) or an embedded plugin (NP_EMBED)
- explicit PluginInstallerImpl(int16 mode);
- virtual ~PluginInstallerImpl();
-
- // Initializes the plugin with the instance information, mime type
- // and the list of parameters passed down to the plugin from the webpage.
- //
- // Parameters:
- // module_handle
- // The handle to the dll in which this object is instantiated.
- // instance
- // The plugins opaque instance handle.
- // mime_type
- // Identifies the third party plugin which would be eventually installed.
- // argc
- // Indicates the count of arguments passed in from the webpage.
- // argv
- // Pointer to the arguments.
- // Returns true on success.
- bool Initialize(void* module_handle, NPP instance, NPMIMEType mime_type,
- int16 argc, char* argn[], char* argv[]);
-
- // Informs the plugin of its window information.
- //
- // Parameters:
- // window_info
- // The window info passed to npapi.
- bool NPP_SetWindow(NPWindow* window_info);
-
- // Destroys the install dialog.
- void Shutdown();
-
- // Starts plugin download. Spawns the plugin installer after it is
- // downloaded.
- void DownloadPlugin();
-
- // Indicates that the plugin download was cancelled.
- void DownloadCancelled();
-
- // Initializes the plugin download stream.
- //
- // Parameters:
- // stream
- // Pointer to the new stream being created.
- void NewStream(NPStream* stream);
-
- // Uninitializes the plugin download stream.
- //
- // Parameters:
- // stream
- // Pointer to the stream being destroyed.
- // reason
- // Indicates why the stream is being destroyed.
- //
- void DestroyStream(NPStream* stream, NPError reason);
-
- // Determines whether the plugin is ready to accept data.
- // We only accept data when we have initiated a download for the plugin
- // database.
- //
- // Parameters:
- // stream
- // Pointer to the stream being destroyed.
- // Returns true if the plugin is ready to accept data.
- bool WriteReady(NPStream* stream);
-
- // Delivers data to the plugin instance.
- //
- // Parameters:
- // stream
- // Pointer to the stream being destroyed.
- // offset
- // Indicates the data offset.
- // buffer_length
- // Indicates the length of the data buffer.
- // buffer
- // Pointer to the actual buffer.
- // Returns the number of bytes actually written, 0 on error.
- int32 Write(NPStream* stream, int32 offset, int32 buffer_length,
- void* buffer);
-
- // Handles notifications received in response to GetURLNotify calls issued
- // by the plugin.
- //
- // Parameters:
- // url
- // Pointer to the URL.
- // reason
- // Describes why the notification was sent.
- void URLNotify(const char* url, NPReason reason);
-
- // Used by the renderer to indicate plugin install through the infobar.
- int16 NPP_HandleEvent(void* event);
-
- const std::string& mime_type() const { return mime_type_; }
-
- // Replaces a resource string with the placeholder passed in as an argument
- //
- // Parameters:
- // message_id_with_placeholders
- // The resource id of the string with placeholders. This is only used if
- // the placeholder string (the replacement_string) parameter is valid.
- // message_id_without_placeholders
- // The resource id of the string to be returned if the placeholder is
- // empty.
- // replacement_string
- // The placeholder which replaces tokens in the string identified by
- // resource id message_id_with_placeholders.
- // Returns a string which has the placeholders replaced, or the string
- // without placeholders.
- static std::wstring ReplaceStringForPossibleEmptyReplacement(
- int message_id_with_placeholders, int message_id_without_placeholders,
- const std::wstring& replacement_string);
-
- // Setter/getter combination to set and retreieve the current
- // state of the plugin installer.
- void set_plugin_installer_state(PluginInstallerState new_state) {
- plugin_installer_state_ = new_state;
- }
-
- PluginInstallerState plugin_installer_state() const {
- return plugin_installer_state_;
- }
-
- // Getter for the NPP instance member.
- const NPP instance() const {
- return instance_;
- }
-
- // Returns whether or not the UI layout is right-to-left (such as Hebrew or
- // Arabic).
- bool IsRTLLayout() const;
-
- protected:
- // Displays the plugin install confirmation dialog.
- void ShowInstallDialog();
-
- // Clears the current display state.
- void ClearDisplay();
-
- // Displays the status message identified by the message resource id
- // passed in.
- //
- // Parameters:
- // message_resource_id parameter
- // The resource id of the message to be displayed.
- void DisplayStatus(int message_resource_id);
-
- // Displays status information for the third party plugin which is needed
- // by the page.
- void DisplayAvailablePluginStatus();
-
- // Displays information related to third party plugin download failure.
- void DisplayPluginDownloadFailedStatus();
-
- // Enables the plugin window if required and initiates an update of the
- // the plugin window.
- void RefreshDisplay();
-
- // Create tooltip window.
- bool CreateToolTip();
-
- // Update ToolTip text with the message shown inside the default plugin.
- void UpdateToolTip();
-
- // Resolves the relative URL (could be already an absolute URL too) to return
- // full URL based on current document's URL and base.
- //
- // Parameters:
- // instance
- // The plugins opaque instance handle.
- // relative_url
- // The URL to be resolved.
- // Returns the resolved URL.
- std::string ResolveURL(NPP instance, const std::string& relative_url);
-
- // Initializes resources like the icon, fonts, etc needed by the plugin
- // installer
- //
- // Parameters:
- // module_handle
- // Handle to the dll in which this object is instantiated.
- // Returns true on success.
- bool InitializeResources(void *module_handle);
-
- // Parses the plugin instantiation arguments. This includes checking for
- // whether this is an activex install and reading the appropriate
- // arguments like codebase, etc. For plugin installs we download the
- // plugin finder URL and initalize the mime type and the plugin instance
- // info.
- //
- // Parameters:
- // module_handle
- // The handle to the dll in which this object is instantiated.
- // instance
- // The plugins opaque instance handle.
- // mime_type
- // Identifies the third party plugin which would be eventually installed.
- // argc
- // Indicates the count of arguments passed in from the webpage.
- // argv
- // Pointer to the arguments.
- // raw_activex_clsid
- // Output parameter which contains the CLSID of the Activex plugin needed.
- // This is only applicable if the webpage specifically requests an ActiveX
- // control.
- // Returns true on success.
- bool ParseInstantiationArguments(NPMIMEType mime_type, NPP instance,
- int16 argc, char* argn[], char* argv[],
- std::string* raw_activex_clsid);
-
- // Paints user action messages to the plugin window. These include messages
- // like whether the user should click on the plugin window to download the
- // plugin, etc.
- //
- // Parameters:
- // paint_dc
- // The device context returned in BeginPaint.
- // x_origin
- // Horizontal reference point indicating where the text is to be displayed.
- // y_origin
- // Vertical reference point indicating where the text is to be displayed.
- //
- void PaintUserActionInformation(gfx::NativeDrawingContext paint_dc,
- int x_origin, int y_origin);
-
- private:
- // Notify the renderer that plugin is available to download.
- void NotifyPluginStatus(int status);
-
- // The plugins opaque instance handle
- NPP instance_;
- // The current stream.
- NPStream* plugin_install_stream_;
- // The desired mime type.
- std::string mime_type_;
- // The current state of the plugin installer.
- PluginInstallerState plugin_installer_state_;
- // GtkPlug containing everything in the plugin.
- GtkWidget* container_;
-
- DISALLOW_COPY_AND_ASSIGN(PluginInstallerImpl);
-};
-
-#endif // WEBKIT_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_
diff --git a/webkit/default_plugin/plugin_impl_mac.h b/webkit/default_plugin/plugin_impl_mac.h
index dad298e..96686a3 100644
--- a/webkit/default_plugin/plugin_impl_mac.h
+++ b/webkit/default_plugin/plugin_impl_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,8 +8,8 @@
#include <string>
#include <vector>
-#include "gfx/native_widget_types.h"
#include "third_party/npapi/bindings/npapi.h"
+#include "gfx/native_widget_types.h"
// Possible plugin installer states.
enum PluginInstallerState {
@@ -53,7 +53,7 @@ class PluginInstallerImpl {
// argv
// Pointer to the arguments.
// Returns true on success.
- bool Initialize(void* module_handle, NPP instance, NPMIMEType mime_type,
+ bool Initialize(void *module_handle, NPP instance, NPMIMEType mime_type,
int16 argc, char* argn[], char* argv[]);
// Informs the plugin of its window information.
@@ -277,8 +277,7 @@ class PluginInstallerImpl {
// Dimensions of the plugin
uint32_t width_;
uint32_t height_;
-
- DISALLOW_COPY_AND_ASSIGN(PluginInstallerImpl);
+ DISALLOW_EVIL_CONSTRUCTORS(PluginInstallerImpl);
};
diff --git a/webkit/default_plugin/plugin_impl_mac.mm b/webkit/default_plugin/plugin_impl_mac.mm
index dd3cac8..290fa1c 100644
--- a/webkit/default_plugin/plugin_impl_mac.mm
+++ b/webkit/default_plugin/plugin_impl_mac.mm
@@ -172,8 +172,8 @@ void PluginInstallerImpl::ShowInstallDialog() {
void PluginInstallerImpl::NotifyPluginStatus(int status) {
default_plugin::g_browser->getvalue(
- instance_,
- static_cast<NPNVariable>(
- default_plugin::kMissingPluginStatusStart + status),
- NULL);
+ instance_,
+ static_cast<NPNVariable>(
+ default_plugin::kMissingPluginStatusStart + status),
+ NULL);
}
diff --git a/webkit/default_plugin/plugin_impl_win.cc b/webkit/default_plugin/plugin_impl_win.cc
index 55b9164..097991d 100644
--- a/webkit/default_plugin/plugin_impl_win.cc
+++ b/webkit/default_plugin/plugin_impl_win.cc
@@ -639,8 +639,8 @@ bool PluginInstallerImpl::InitializeResources(HINSTANCE module_handle) {
void PluginInstallerImpl::NotifyPluginStatus(int status) {
default_plugin::g_browser->getvalue(
- instance_,
- static_cast<NPNVariable>(
- default_plugin::kMissingPluginStatusStart + status),
- NULL);
+ instance_,
+ static_cast<NPNVariable>(
+ default_plugin::kMissingPluginStatusStart + status),
+ NULL);
}
diff --git a/webkit/default_plugin/plugin_main.cc b/webkit/default_plugin/plugin_main.cc
index 5025007..a4dacc5 100644
--- a/webkit/default_plugin/plugin_main.cc
+++ b/webkit/default_plugin/plugin_main.cc
@@ -28,27 +28,20 @@ inline HMODULE GetCurrentModuleHandle() {
NPNetscapeFuncs* g_browser = NULL;
NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* funcs) {
- // Be explicit about the namespace, because all internal plugins have
- // functions with these names and some might accidentally put them into the
- // global namespace. In that case, the linker might prefer the global one.
funcs->version = 11;
funcs->size = sizeof(*funcs);
- funcs->newp = default_plugin::NPP_New;
- funcs->destroy = default_plugin::NPP_Destroy;
- funcs->setwindow = default_plugin::NPP_SetWindow;
- funcs->newstream = default_plugin::NPP_NewStream;
- funcs->destroystream = default_plugin::NPP_DestroyStream;
- funcs->writeready = default_plugin::NPP_WriteReady;
- funcs->write = default_plugin::NPP_Write;
+ funcs->newp = NPP_New;
+ funcs->destroy = NPP_Destroy;
+ funcs->setwindow = NPP_SetWindow;
+ funcs->newstream = NPP_NewStream;
+ funcs->destroystream = NPP_DestroyStream;
+ funcs->writeready = NPP_WriteReady;
+ funcs->write = NPP_Write;
funcs->asfile = NULL;
funcs->print = NULL;
- funcs->event = default_plugin::NPP_HandleEvent;
- funcs->urlnotify = default_plugin::NPP_URLNotify;
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
- funcs->getvalue = default_plugin::NPP_GetValue;
-#else
+ funcs->event = NPP_HandleEvent;
+ funcs->urlnotify = NPP_URLNotify;
funcs->getvalue = NULL;
-#endif
funcs->setvalue = NULL;
return NPERR_NO_ERROR;
}
@@ -58,18 +51,9 @@ NPError API_CALL NP_Initialize(NPNetscapeFuncs* funcs) {
return 0;
}
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-NPError API_CALL NP_Initialize(NPNetscapeFuncs* funcs, NPPluginFuncs* p_funcs) {
- NPError err = NP_Initialize(funcs);
- if (err != NPERR_NO_ERROR)
- return err;
- return NP_GetEntryPoints(p_funcs);
-}
-#endif
-
NPError API_CALL NP_Shutdown(void) {
g_browser = NULL;
- return NPERR_NO_ERROR;
+ return 0;
}
namespace {
@@ -133,27 +117,6 @@ bool NegotiateModels(NPP instance) {
NOTREACHED();
return false;
}
-#elif defined(OS_POSIX)
- NPError err;
- // Check that chrome still supports xembed.
- NPBool supportsXEmbed = FALSE;
- err = g_browser->getvalue(instance,
- NPNVSupportsXEmbedBool,
- &supportsXEmbed);
- if (err != NPERR_NO_ERROR || !supportsXEmbed) {
- NOTREACHED();
- return false;
- }
-
- // Check that the toolkit is still gtk2.
- NPNToolkitType toolkit;
- err = g_browser->getvalue(instance,
- NPNVToolkit,
- &toolkit);
- if (err != NPERR_NO_ERROR || toolkit != NPNVGtk2) {
- NOTREACHED();
- return false;
- }
#endif
return true;
}
@@ -317,18 +280,6 @@ void NPP_URLNotify(NPP instance, const char* url, NPReason reason,
}
}
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-NPError NPP_GetValue(NPP instance, NPPVariable variable, void* value) {
- switch (variable) {
- case NPPVpluginNeedsXEmbed:
- *static_cast<NPBool*>(value) = TRUE;
- return NPERR_NO_ERROR;
- default:
- return NPERR_INVALID_PARAM;
- }
-}
-#endif
-
int16 NPP_HandleEvent(NPP instance, void* event) {
if (instance == NULL)
return 0;
diff --git a/webkit/default_plugin/plugin_main.h b/webkit/default_plugin/plugin_main.h
index dc1e071..4f73651 100644
--- a/webkit/default_plugin/plugin_main.h
+++ b/webkit/default_plugin/plugin_main.h
@@ -23,19 +23,12 @@ NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
int32 NPP_WriteReady(NPP instance, NPStream* stream);
int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
void* buffer);
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-NPError NPP_GetValue(NPP instance, NPPVariable variable, void* value);
-#endif
void NPP_URLNotify(NPP instance, const char* url, NPReason reason,
void* notifyData);
int16 NPP_HandleEvent(NPP instance, void* event);
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-NPError API_CALL NP_Initialize(NPNetscapeFuncs* funcs, NPPluginFuncs* p_funcs);
-#else
NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* funcs);
NPError API_CALL NP_Initialize(NPNetscapeFuncs* funcs);
-#endif
NPError API_CALL NP_Shutdown(void);
} // default_plugin