diff options
author | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-05 01:23:44 +0000 |
---|---|---|
committer | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-05 01:23:44 +0000 |
commit | 47217cf0e17aa7aa5da0401bd5ea17203da4aed7 (patch) | |
tree | 3d9720e09cb0eacc8a5a0d59c26f3123ffc57ba2 /chrome/common | |
parent | 5a5fdc08c1ae8fdfce391f1a17c5fbb6097ab280 (diff) | |
download | chromium_src-47217cf0e17aa7aa5da0401bd5ea17203da4aed7.zip chromium_src-47217cf0e17aa7aa5da0401bd5ea17203da4aed7.tar.gz chromium_src-47217cf0e17aa7aa5da0401bd5ea17203da4aed7.tar.bz2 |
Revert r108744, r108753 - "Modify code in chrome to call wrapper functions on PluginService"
TBR=jam@chromium.org
Review URL: http://codereview.chromium.org/8475020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108760 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_content_client.cc | 34 | ||||
-rw-r--r-- | chrome/common/chrome_content_client.h | 2 | ||||
-rw-r--r-- | chrome/common/default_plugin.cc | 44 | ||||
-rw-r--r-- | chrome/common/default_plugin.h | 16 |
4 files changed, 60 insertions, 36 deletions
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index 65b004b..a015b75 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -12,20 +12,17 @@ #include "base/stringprintf.h" #include "base/string_split.h" #include "base/string_util.h" -#include "base/utf_string_conversions.h" #include "base/win/windows_version.h" #include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/render_messages.h" -#include "chrome/default_plugin/plugin_main.h" #include "content/public/common/pepper_plugin_info.h" #include "remoting/client/plugin/pepper_entrypoints.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "webkit/glue/user_agent.h" -#include "webkit/plugins/npapi/plugin_list.h" #include "webkit/plugins/plugin_constants.h" #if defined(OS_WIN) @@ -269,37 +266,6 @@ void ChromeContentClient::AddPepperPlugins( AddOutOfProcessFlash(plugins); } -void ChromeContentClient::AddNPAPIPlugins( - webkit::npapi::PluginList* plugin_list) { -#if defined(OS_WIN) && !defined(USE_AURA) - // TODO(bauerb): On Windows the default plug-in can download and install - // missing plug-ins, which we don't support in the browser yet, so keep - // using the default plug-in on Windows until we do. - // Aura isn't going to support NPAPI plugins. - const webkit::npapi::PluginEntryPoints entry_points = { - default_plugin::NP_GetEntryPoints, - default_plugin::NP_Initialize, - default_plugin::NP_Shutdown - }; - - webkit::WebPluginInfo info; - info.path = FilePath(webkit::npapi::kDefaultPluginLibraryName); - info.name = ASCIIToUTF16("Default Plug-in"); - info.version = ASCIIToUTF16("1"); - info.desc = ASCIIToUTF16("Provides functionality for installing third-party " - "plug-ins"); - - webkit::WebPluginMimeType mimeType; - mimeType.mime_type = "*"; - info.mime_types.push_back(mimeType); - - webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( - info, - entry_points, - false); -#endif -} - bool ChromeContentClient::CanSendWhileSwappedOut(const IPC::Message* msg) { // Any Chrome-specific messages that must be allowed to be sent from swapped // out renderers. diff --git a/chrome/common/chrome_content_client.h b/chrome/common/chrome_content_client.h index 6c252e1..5d82037 100644 --- a/chrome/common/chrome_content_client.h +++ b/chrome/common/chrome_content_client.h @@ -21,8 +21,6 @@ class ChromeContentClient : public content::ContentClient { virtual void SetGpuInfo(const content::GPUInfo& gpu_info) OVERRIDE; virtual void AddPepperPlugins( std::vector<content::PepperPluginInfo>* plugins) OVERRIDE; - virtual void AddNPAPIPlugins( - webkit::npapi::PluginList* plugin_list) OVERRIDE; virtual bool CanSendWhileSwappedOut(const IPC::Message* msg) OVERRIDE; virtual bool CanHandleWhileSwappedOut(const IPC::Message& msg) OVERRIDE; virtual std::string GetUserAgent(bool* overriding) const OVERRIDE; diff --git a/chrome/common/default_plugin.cc b/chrome/common/default_plugin.cc new file mode 100644 index 0000000..b9b8fab --- /dev/null +++ b/chrome/common/default_plugin.cc @@ -0,0 +1,44 @@ +// Copyright (c) 2011 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 "base/utf_string_conversions.h" +#include "chrome/common/default_plugin.h" +#include "chrome/default_plugin/plugin_main.h" +#include "webkit/plugins/npapi/plugin_list.h" + +namespace chrome { + +void RegisterInternalDefaultPlugin() { +#if defined(OS_WIN) && !defined(USE_AURA) + // TODO(bauerb): On Windows the default plug-in can download and install + // missing plug-ins, which we don't support in the browser yet, so keep + // using the default plug-in on Windows until we do. + // Aura isn't going to support NPAPI plugins. + const webkit::npapi::PluginEntryPoints entry_points = { +#if !defined(OS_POSIX) || defined(OS_MACOSX) + default_plugin::NP_GetEntryPoints, +#endif + default_plugin::NP_Initialize, + default_plugin::NP_Shutdown + }; + + webkit::WebPluginInfo info; + info.path = FilePath(webkit::npapi::kDefaultPluginLibraryName); + info.name = ASCIIToUTF16("Default Plug-in"); + info.version = ASCIIToUTF16("1"); + info.desc = ASCIIToUTF16("Provides functionality for installing third-party " + "plug-ins"); + + webkit::WebPluginMimeType mimeType; + mimeType.mime_type = "*"; + info.mime_types.push_back(mimeType); + + webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( + info, + entry_points, + false); +#endif +} + +} // namespace chrome diff --git a/chrome/common/default_plugin.h b/chrome/common/default_plugin.h new file mode 100644 index 0000000..6cc8348 --- /dev/null +++ b/chrome/common/default_plugin.h @@ -0,0 +1,16 @@ +// 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 CHROME_COMMON_DEFAULT_PLUGIN_H_ +#define CHROME_COMMON_DEFAULT_PLUGIN_H_ +#pragma once + +namespace chrome { + +// Register the default plugin as an internal plugin in the PluginList. +void RegisterInternalDefaultPlugin(); + +} // namespace chrome + +#endif // CHROME_COMMON_DEFAULT_PLUGIN_H_ |