diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 17:45:46 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 17:45:46 +0000 |
commit | b39c9b201b7a950c647cd9d79494b74692dfeb56 (patch) | |
tree | d2dec1cb8f613e3f56b90651c5e4ae073048b038 | |
parent | 135e429c705aa5b8fd26f2b0a46ad63451817b3c (diff) | |
download | chromium_src-b39c9b201b7a950c647cd9d79494b74692dfeb56.zip chromium_src-b39c9b201b7a950c647cd9d79494b74692dfeb56.tar.gz chromium_src-b39c9b201b7a950c647cd9d79494b74692dfeb56.tar.bz2 |
Remove the default plugin.
TBR=darin@chromium.org
BUG=62079
TEST=none
Review URL: http://codereview.chromium.org/9074004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118855 0039d316-1c4b-4281-b951-d872f2087c98
64 files changed, 29 insertions, 3944 deletions
diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc index 452c9ae..4027c54 100644 --- a/chrome/app/chrome_dll.rc +++ b/chrome/app/chrome_dll.rc @@ -248,11 +248,6 @@ END #include "installer_util_strings.rc" -// We include these resources because all ICON types need to be in the -// same .rc file. See: -// http://www.technewsgroups.net/group/microsoft.public.dotnet.general/topic2111.aspx -#include "chrome\\default_plugin\\default_plugin_resources.rc" - #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index e592cf9..5ccd4e3 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -9527,9 +9527,6 @@ experiment id: "<ph name="EXPERIMENT_ID">$5<ex>ar1</ex></ph>" Proceed anyway </message> - <message name="IDS_PLUGININSTALLER_MISSINGPLUGIN_PROMPT" desc="Info Bar message to prompt installing missing plugin"> - An additional plug-in is required to display some elements on this page. - </message> <message name="IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT" desc="Info Bar message to prompt installing missing plugin"> The <ph name="PLUGIN_NAME">$1<ex>Quicktime</ex></ph> plug-in is required to display some elements on this page. </message> diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 5a852d0..a3c42fe 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -16,7 +16,6 @@ #include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/character_encoding.h" #include "chrome/browser/chrome_benchmarking_message_filter.h" -#include "chrome/browser/chrome_plugin_message_filter.h" #include "chrome/browser/chrome_quota_permission_context.h" #include "chrome/browser/content_settings/content_settings_utils.h" #include "chrome/browser/content_settings/cookie_settings.h" @@ -359,13 +358,6 @@ void ChromeContentBrowserClient::RenderProcessHostCreated( host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); } -void ChromeContentBrowserClient::PluginProcessHostCreated( - PluginProcessHost* host) { -#if !defined(USE_AURA) - host->AddFilter(new ChromePluginMessageFilter(host)); -#endif -} - content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() { return ChromeWebUIFactory::GetInstance(); } diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index dea7912..9e49232 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -22,7 +22,6 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual void RenderViewHostCreated(RenderViewHost* render_view_host) OVERRIDE; virtual void RenderProcessHostCreated( content::RenderProcessHost* host) OVERRIDE; - virtual void PluginProcessHostCreated(PluginProcessHost* host) OVERRIDE; virtual content::WebUIFactory* GetWebUIFactory() OVERRIDE; virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, const GURL& effective_url) OVERRIDE; diff --git a/chrome/browser/chrome_plugin_message_filter.cc b/chrome/browser/chrome_plugin_message_filter.cc deleted file mode 100644 index aa85dcd..0000000 --- a/chrome/browser/chrome_plugin_message_filter.cc +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) 2012 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 "chrome/browser/chrome_plugin_message_filter.h" - -#include "base/bind.h" -#include "base/file_path.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/infobars/infobar_tab_helper.h" -#include "chrome/browser/plugin_installer_infobar_delegate.h" -#include "chrome/browser/plugin_observer.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "chrome/common/chrome_plugin_messages.h" -#include "content/browser/plugin_process_host.h" -#include "content/browser/renderer_host/render_view_host.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/render_process_host.h" -#include "content/public/browser/render_view_host_delegate.h" -#include "net/url_request/url_request_context_getter.h" -#include "webkit/plugins/npapi/default_plugin_shared.h" - -#if defined(OS_WIN) -#include "chrome/browser/plugin_download_helper.h" -#endif - -using content::BrowserThread; - -static const char kDefaultPluginFinderURL[] = - "https://ssl.gstatic.com/chrome/config/plugins2.xml"; - -ChromePluginMessageFilter::ChromePluginMessageFilter(PluginProcessHost* process) - : process_(process) { -} - -ChromePluginMessageFilter::~ChromePluginMessageFilter() { -} - -bool ChromePluginMessageFilter::OnMessageReceived(const IPC::Message& message) { - bool handled = true; - IPC_BEGIN_MESSAGE_MAP(ChromePluginMessageFilter, message) -#if defined(OS_WIN) - IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_DownloadUrl, OnDownloadUrl) -#endif - IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_GetPluginFinderUrl, - OnGetPluginFinderUrl) - IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_MissingPluginStatus, - OnMissingPluginStatus) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - - return handled; -} - -bool ChromePluginMessageFilter::Send(IPC::Message* message) { - return process_->Send(message); -} - -#if defined(OS_WIN) -void ChromePluginMessageFilter::OnDownloadUrl(const std::string& url, - gfx::NativeWindow caller_window, - int render_process_id) { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - base::Bind(&ChromePluginMessageFilter::OnDownloadUrlOnUIThread, - url, caller_window, - render_process_id)); -} - -// static -void ChromePluginMessageFilter::OnDownloadUrlOnUIThread( - const std::string& url, - gfx::NativeWindow caller_window, - int render_process_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - content::RenderProcessHost* host = - content::RenderProcessHost::FromID(render_process_id); - if (!host) { - return; - } - // |download_url_helper| will delete itself after running the callback. - PluginDownloadUrlHelper* download_url_helper = - new PluginDownloadUrlHelper(); - download_url_helper->InitiateDownload( - GURL(url), - host->GetBrowserContext()->GetRequestContext(), - base::Bind(&ChromePluginMessageFilter::PluginDownloadFinished, - caller_window), - base::Bind(&ChromePluginMessageFilter::PluginDownloadError)); -} - -// static -void ChromePluginMessageFilter::PluginDownloadFinished( - gfx::NativeWindow caller_window, - const FilePath& response_file) { - FilePath::StringType path = response_file.value(); - COPYDATASTRUCT download_file_data = {0}; - download_file_data.cbData = - static_cast<unsigned long>((path.length() + 1) * - sizeof(FilePath::CharType)); - download_file_data.lpData = const_cast<FilePath::CharType *>(path.c_str()); - download_file_data.dwData = !path.empty(); - - if (::IsWindow(caller_window)) { - ::SendMessage(caller_window, WM_COPYDATA, NULL, - reinterpret_cast<LPARAM>(&download_file_data)); - } -} - -// static -void ChromePluginMessageFilter::PluginDownloadError( - const std::string& error) { - NOTREACHED() << error; -} -#endif // OS_WIN - -void ChromePluginMessageFilter::OnGetPluginFinderUrl( - std::string* plugin_finder_url) { - // TODO(bauerb): Move this method to MessageFilter. - if (!g_browser_process->plugin_finder_disabled()) { - // TODO(iyengar): Add the plumbing to retrieve the default - // plugin finder URL. - *plugin_finder_url = kDefaultPluginFinderURL; - } else { - plugin_finder_url->clear(); - } -} - -void ChromePluginMessageFilter::OnMissingPluginStatus( - int status, int render_process_id, int render_view_id, - gfx::NativeWindow window) { - BrowserThread::PostTask( - BrowserThread::UI, - FROM_HERE, - base::Bind( - &ChromePluginMessageFilter::HandleMissingPluginStatus, - status, render_process_id, render_view_id, window)); -} - -// static -void ChromePluginMessageFilter::HandleMissingPluginStatus( - int status, int render_process_id, int render_view_id, - gfx::NativeWindow window) { -// TODO(PORT): pull in when plug-ins work -#if defined(OS_WIN) - RenderViewHost* host = RenderViewHost::FromID(render_process_id, - render_view_id); - if (!host || !host->delegate() || !host->delegate()->GetAsWebContents()) - return; - - TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( - host->delegate()->GetAsWebContents()); - DCHECK(tcw); - InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper(); - - if (status == webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE) { - infobar_helper->AddInfoBar(new PluginInstallerInfoBarDelegate( - NULL, infobar_helper, string16(), GURL(), - base::Bind(&ChromePluginMessageFilter::InstallMissingPlugin, - base::Unretained(window)))); - return; - } - - DCHECK_EQ(webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD, - status); - for (size_t i = 0; i < infobar_helper->infobar_count(); ++i) { - InfoBarDelegate* delegate = infobar_helper->GetInfoBarDelegateAt(i); - if (delegate->AsPluginInstallerInfoBarDelegate() != NULL) { - infobar_helper->RemoveInfoBar(delegate); - return; - } - } -#else - // TODO(port): Implement the infobar that accompanies the default plugin. - // Linux: http://crbug.com/10952 - // Mac: http://crbug.com/17392 - NOTIMPLEMENTED(); -#endif // OS_WIN -} - -// static -void ChromePluginMessageFilter::InstallMissingPlugin(gfx::NativeWindow window) { -#if defined(OS_WIN) - ::PostMessage(window, - webkit::npapi::default_plugin::kInstallMissingPluginMessage, - 0, - 0); -#else - NOTIMPLEMENTED(); -#endif // OS_WIN -} diff --git a/chrome/browser/chrome_plugin_message_filter.h b/chrome/browser/chrome_plugin_message_filter.h deleted file mode 100644 index 99d5834..0000000 --- a/chrome/browser/chrome_plugin_message_filter.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2012 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_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ -#define CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ -#pragma once - -#include "ipc/ipc_channel_proxy.h" -#include "ui/gfx/native_widget_types.h" - -class FilePath; -class PluginProcessHost; - -namespace net { -class URLRequestContextGetter; -}; - -// This class filters out incoming Chrome-specific IPC messages for the plugin -// process on the IPC thread. -class ChromePluginMessageFilter : public IPC::ChannelProxy::MessageFilter, - public IPC::Message::Sender { - public: - explicit ChromePluginMessageFilter(PluginProcessHost* process); - - // IPC::ChannelProxy::MessageFilter methods: - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - - // IPC::Message::Sender methods: - virtual bool Send(IPC::Message* message) OVERRIDE; - - private: - virtual ~ChromePluginMessageFilter(); - -#if defined(OS_WIN) - void OnDownloadUrl(const std::string& url, - gfx::NativeWindow caller_window, - int render_process_id); - // Helper function to handle the initial portions of the download request - // on the UI thread. - static void OnDownloadUrlOnUIThread(const std::string& url, - gfx::NativeWindow caller_window, - int render_process_id); - static void PluginDownloadFinished(gfx::NativeWindow caller_window, - const FilePath& response_file); - static void PluginDownloadError(const std::string& error); -#endif - - void OnGetPluginFinderUrl(std::string* plugin_finder_url); - void OnMissingPluginStatus(int status, - int render_process_id, - int render_view_id, - gfx::NativeWindow window); - - static void HandleMissingPluginStatus(int status, - int render_process_id, - int render_view_id, - gfx::NativeWindow window); - - static void InstallMissingPlugin(gfx::NativeWindow window); - - PluginProcessHost* process_; - - DISALLOW_COPY_AND_ASSIGN(ChromePluginMessageFilter); -}; - -#endif // CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ diff --git a/chrome/browser/default_plugin_uitest.cc b/chrome/browser/default_plugin_uitest.cc deleted file mode 100644 index eb64292..0000000 --- a/chrome/browser/default_plugin_uitest.cc +++ /dev/null @@ -1,41 +0,0 @@ -// 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/basictypes.h" -#include "base/file_path.h" -#include "build/build_config.h" -#include "chrome/test/automation/tab_proxy.h" -#include "chrome/test/ui/ui_test.h" -#include "net/base/net_util.h" - -class DefaultPluginUITest : public UITest { - public: - DefaultPluginUITest() { - dom_automation_enabled_ = true; - } -}; - -#if defined(OS_WIN) -#if defined(COMPONENT_BUILD) -// http://crbug.com/107735 -#define MAYBE_DefaultPluginLoadTest DISABLED_DefaultPluginLoadTest -#else -#define MAYBE_DefaultPluginLoadTest DefaultPluginLoadTest -#endif // COMPONENT_BUILD -TEST_F(DefaultPluginUITest, MAYBE_DefaultPluginLoadTest) { - // Open page with default plugin. - FilePath test_file(test_data_directory_); - test_file = test_file.AppendASCII("default_plugin.html"); - NavigateToURL(net::FilePathToFileURL(test_file)); - - // Check that the default plugin was loaded. It executes a bit of javascript - // in the HTML file which replaces the innerHTML of div |result| with "DONE". - scoped_refptr<TabProxy> tab(GetActiveTab()); - std::wstring out; - ASSERT_TRUE(tab->ExecuteAndExtractString(L"", - L"domAutomationController.send(" - L"document.getElementById('result').innerHTML)", &out)); - ASSERT_EQ(L"DONE", out); -} -#endif diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc index 56f8694..a92ccd6 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -803,20 +803,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { const Extension* extension = LoadExtension(extension_dir); ASSERT_TRUE(extension); EXPECT_EQ(size_before + 1, service->extensions()->size()); - // Now the plugin should be in the cache, but we have to reload the page for - // it to work. - ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); - EXPECT_FALSE(result); - { - ui_test_utils::WindowedNotificationObserver observer( - content::NOTIFICATION_LOAD_STOP, - content::Source<NavigationController>( - &browser()->GetSelectedTabContentsWrapper()->web_contents()-> - GetController())); - browser()->Reload(CURRENT_TAB); - observer.Wait(); - } + // Now the plugin should be in the cache. ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); EXPECT_TRUE(result); diff --git a/chrome/browser/infobars/infobar_delegate.cc b/chrome/browser/infobars/infobar_delegate.cc index a8d5c4f..bcaf344 100644 --- a/chrome/browser/infobars/infobar_delegate.cc +++ b/chrome/browser/infobars/infobar_delegate.cc @@ -63,11 +63,6 @@ LinkInfoBarDelegate* InfoBarDelegate::AsLinkInfoBarDelegate() { return NULL; } -PluginInstallerInfoBarDelegate* - InfoBarDelegate::AsPluginInstallerInfoBarDelegate() { - return NULL; -} - RegisterProtocolHandlerInfoBarDelegate* InfoBarDelegate::AsRegisterProtocolHandlerInfoBarDelegate() { return NULL; diff --git a/chrome/browser/infobars/infobar_delegate.h b/chrome/browser/infobars/infobar_delegate.h index 55a2bd5..785f67b 100644 --- a/chrome/browser/infobars/infobar_delegate.h +++ b/chrome/browser/infobars/infobar_delegate.h @@ -88,7 +88,6 @@ class InfoBarDelegate { virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate(); virtual InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate(); virtual LinkInfoBarDelegate* AsLinkInfoBarDelegate(); - virtual PluginInstallerInfoBarDelegate* AsPluginInstallerInfoBarDelegate(); virtual RegisterProtocolHandlerInfoBarDelegate* AsRegisterProtocolHandlerInfoBarDelegate(); virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); diff --git a/chrome/browser/plugin_installer_infobar_delegate.cc b/chrome/browser/plugin_installer_infobar_delegate.cc index 9e040c8..5945760 100644 --- a/chrome/browser/plugin_installer_infobar_delegate.cc +++ b/chrome/browser/plugin_installer_infobar_delegate.cc @@ -38,17 +38,9 @@ gfx::Image* PluginInstallerInfoBarDelegate::GetIcon() const { IDR_INFOBAR_PLUGIN_INSTALL); } -PluginInstallerInfoBarDelegate* - PluginInstallerInfoBarDelegate::AsPluginInstallerInfoBarDelegate() { - return this; -} - string16 PluginInstallerInfoBarDelegate::GetMessageText() const { - // TODO(bauerb): Remove this check when removing the default plug-in. - return plugin_name_.empty() ? - l10n_util::GetStringUTF16(IDS_PLUGININSTALLER_MISSINGPLUGIN_PROMPT) : - l10n_util::GetStringFUTF16(IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT, - plugin_name_); + return l10n_util::GetStringFUTF16(IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT, + plugin_name_); } int PluginInstallerInfoBarDelegate::GetButtons() const { @@ -73,7 +65,6 @@ string16 PluginInstallerInfoBarDelegate::GetLinkText() const { bool PluginInstallerInfoBarDelegate::LinkClicked( WindowOpenDisposition disposition) { GURL url(learn_more_url_); - // TODO(bauerb): Remove this check when removing the default plug-in. if (url.is_empty()) { url = google_util::AppendGoogleLocaleParam(GURL( "https://www.google.com/support/chrome/bin/answer.py?answer=142064")); diff --git a/chrome/browser/plugin_installer_infobar_delegate.h b/chrome/browser/plugin_installer_infobar_delegate.h index b72da4e..b43b623 100644 --- a/chrome/browser/plugin_installer_infobar_delegate.h +++ b/chrome/browser/plugin_installer_infobar_delegate.h @@ -31,8 +31,6 @@ class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate, // ConfirmInfoBarDelegate: virtual gfx::Image* GetIcon() const OVERRIDE; - virtual PluginInstallerInfoBarDelegate* - AsPluginInstallerInfoBarDelegate() OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index 779d2c9..d65fc71 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h @@ -140,7 +140,6 @@ class Profile : public content::BrowserContext { friend bool IsGoogleGAIACookieInstalled(); friend class AutofillDownloadManager; - friend class ChromePluginMessageFilter; friend class BrowserListTabContentsProvider; friend class MetricsService; friend class SafeBrowsingServiceTestHelper; diff --git a/chrome/browser/renderer_host/plugin_info_message_filter.cc b/chrome/browser/renderer_host/plugin_info_message_filter.cc index 1b85efd5..c1e1f48 100644 --- a/chrome/browser/renderer_host/plugin_info_message_filter.cc +++ b/chrome/browser/renderer_host/plugin_info_message_filter.cc @@ -230,20 +230,15 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin( url, top_origin_url, &matching_plugins[i]); - bool is_default_plugin = matching_plugins[i].path == - FilePath(webkit::npapi::kDefaultPluginLibraryName); - if (enabled) { - if (!found || !is_default_plugin) { + if (!found || enabled) { + *plugin = matching_plugins[i]; + *actual_mime_type = mime_types[i]; + if (enabled) { // We have found an enabled plug-in. Return immediately. - *plugin = matching_plugins[i]; - *actual_mime_type = mime_types[i]; return false; } - } else if (!found && !is_default_plugin) { // We have found a plug-in, but it's disabled. Keep looking for an // enabled one. - *plugin = matching_plugins[i]; - *actual_mime_type = mime_types[i]; found = true; } } diff --git a/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc b/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc index 5e4a1cf..6b27be6 100644 --- a/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc +++ b/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc @@ -61,7 +61,6 @@ bool FakePluginServiceFilter::ShouldUsePlugin(int render_process_id, class PluginInfoMessageFilterTest : public ::testing::Test { public: PluginInfoMessageFilterTest() : - default_plugin_path_(webkit::npapi::kDefaultPluginLibraryName), foo_plugin_path_(FILE_PATH_LITERAL("/path/to/foo")), bar_plugin_path_(FILE_PATH_LITERAL("/path/to/bar")), file_thread_(content::BrowserThread::FILE, &message_loop_), @@ -86,16 +85,6 @@ class PluginInfoMessageFilterTest : public ::testing::Test { bar_plugin.mime_types.push_back(mimeType); plugin_list_.AddPluginToLoad(bar_plugin); - webkit::WebPluginInfo default_plugin( - ASCIIToUTF16("Default Plug-in"), - default_plugin_path_, - ASCIIToUTF16("1"), - ASCIIToUTF16("Provides functionality for installing third-party " - "plug-ins")); - mimeType.mime_type = "*"; - default_plugin.mime_types.push_back(mimeType); - plugin_list_.AddPluginToLoad(default_plugin); - PluginService::GetInstance()->SetPluginListForTesting(&plugin_list_); PluginService::GetInstance()->SetFilter(&filter_); @@ -106,7 +95,6 @@ class PluginInfoMessageFilterTest : public ::testing::Test { } protected: - FilePath default_plugin_path_; FilePath foo_plugin_path_; FilePath bar_plugin_path_; FakePluginServiceFilter filter_; @@ -128,7 +116,6 @@ class PluginInfoMessageFilterTest : public ::testing::Test { TEST_F(PluginInfoMessageFilterTest, FindEnabledPlugin) { filter_.set_plugin_enabled(foo_plugin_path_, true); filter_.set_plugin_enabled(bar_plugin_path_, true); - filter_.set_plugin_enabled(default_plugin_path_, true); { ChromeViewHostMsg_GetPluginInfo_Status status; webkit::WebPluginInfo plugin; @@ -138,15 +125,6 @@ TEST_F(PluginInfoMessageFilterTest, FindEnabledPlugin) { EXPECT_EQ(ChromeViewHostMsg_GetPluginInfo_Status::kAllowed, status.value); EXPECT_EQ(foo_plugin_path_.value(), plugin.path.value()); } - { - ChromeViewHostMsg_GetPluginInfo_Status status; - webkit::WebPluginInfo plugin; - std::string actual_mime_type; - EXPECT_FALSE(context_.FindEnabledPlugin( - 0, GURL(), GURL(), "baz/blurp", &status, &plugin, &actual_mime_type)); - EXPECT_EQ(ChromeViewHostMsg_GetPluginInfo_Status::kAllowed, status.value); - EXPECT_EQ(default_plugin_path_.value(), plugin.path.value()); - } filter_.set_plugin_enabled(foo_plugin_path_, false); { @@ -169,8 +147,6 @@ TEST_F(PluginInfoMessageFilterTest, FindEnabledPlugin) { EXPECT_EQ(ChromeViewHostMsg_GetPluginInfo_Status::kDisabled, status.value); EXPECT_EQ(foo_plugin_path_.value(), plugin.path.value()); } - - filter_.set_plugin_enabled(default_plugin_path_, false); { ChromeViewHostMsg_GetPluginInfo_Status status; webkit::WebPluginInfo plugin; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index d30d3ee..35334e2 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -387,8 +387,6 @@ 'browser/chrome_page_zoom_constants.h', 'browser/chrome_page_zoom.cc', 'browser/chrome_page_zoom.h', - 'browser/chrome_plugin_message_filter.cc', - 'browser/chrome_plugin_message_filter.h', 'browser/chrome_plugin_service_filter.cc', 'browser/chrome_plugin_service_filter.h', 'browser/chrome_quota_permission_context.cc', @@ -4366,8 +4364,6 @@ ['exclude', '^browser/automation/chrome_frame_automation_provider.cc'], ['exclude', '^browser/automation/chrome_frame_automation_provider.h'], ['exclude', '^browser/automation/testing_automation_provider_win.cc'], - ['exclude', '^browser/chrome_plugin_message_filter.cc'], - ['exclude', '^browser/chrome_plugin_message_filter.h'], ['exclude', '^browser/chromeos/native_dialog_window.cc'], ['exclude', '^browser/chromeos/native_dialog_window.h'], ['exclude', '^browser/chromeos/frame/bubble_frame_view.h'], diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index a4bfcfa..63d0b1e 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -255,11 +255,6 @@ '<(DEPTH)/third_party/wtl/include', ] }], - ['OS=="win" and use_aura==0', { - 'dependencies': [ - '<(DEPTH)/chrome/default_plugin/default_plugin.gyp:default_plugin', - ] - }], ['toolkit_uses_gtk == 1', { 'dependencies': [ '../build/linux/system.gyp:gtk', diff --git a/chrome/chrome_repack_chrome.gypi b/chrome/chrome_repack_chrome.gypi index 5381dfd..a1e8305 100644 --- a/chrome/chrome_repack_chrome.gypi +++ b/chrome/chrome_repack_chrome.gypi @@ -7,7 +7,6 @@ 'pak_inputs': [ '<(grit_out_dir)/browser_resources.pak', '<(grit_out_dir)/common_resources.pak', - '<(grit_out_dir)/default_plugin_resources/default_plugin_resources.pak', '<(grit_out_dir)/renderer_resources.pak', '<(grit_out_dir)/theme_resources.pak', '<(grit_out_dir)/theme_resources_standard.pak', diff --git a/chrome/chrome_resources.gyp b/chrome/chrome_resources.gyp index 59b6143..fc15532 100644 --- a/chrome/chrome_resources.gyp +++ b/chrome/chrome_resources.gyp @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 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. { @@ -305,7 +305,6 @@ # derive the dependencies from the output files. 'chrome_resources', 'chrome_strings', - 'default_plugin/default_plugin.gyp:default_plugin_resources', 'platform_locale_settings', 'theme_resources', '<(DEPTH)/content/content_resources.gyp:content_resources', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 824bfe7..b4dbbe5 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -791,7 +791,6 @@ 'browser/browser_encoding_uitest.cc', 'browser/custom_handlers/custom_handlers_uitest.cc', 'browser/download/save_page_uitest.cc', - 'browser/default_plugin_uitest.cc', 'browser/fast_shutdown_uitest.cc', 'browser/history/multipart_uitest.cc', 'browser/history/redirect_uitest.cc', @@ -872,7 +871,6 @@ 'sources!': [ 'test/automation/automation_proxy_uitest.cc', 'test/ui/npapi_uitest.cc', - 'browser/default_plugin_uitest.cc', ], 'dependencies': [ '../ui/aura/aura.gyp:aura', @@ -904,12 +902,6 @@ '<(allocator_target)', ], }], - ['use_aura==0', { - 'dependencies': [ - # Runtime dependency - 'default_plugin/default_plugin.gyp:default_plugin', - ] - }], ], 'link_settings': { 'libraries': [ diff --git a/chrome/common/DEPS b/chrome/common/DEPS index e637574..74fbaa8 100644 --- a/chrome/common/DEPS +++ b/chrome/common/DEPS @@ -1,6 +1,5 @@ include_rules = [ "+chrome/plugin", # For checking whether we're a plugin process. - "+chrome/default_plugin", "+grit", # For generated headers "+libxml", "+ppapi/c", # For various types. diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index 58c5584..1a0c7c8 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -19,7 +19,6 @@ #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 "grit/common_resources.h" #include "remoting/client/plugin/pepper_entrypoints.h" @@ -316,31 +315,6 @@ void ChromeContentClient::AddPepperPlugins( 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()->RegisterInternalPluginWithEntryPoints( - info, false, entry_points); -#endif } bool ChromeContentClient::CanSendWhileSwappedOut(const IPC::Message* msg) { diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 9fe2425..a868577 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -1252,7 +1252,7 @@ const char kDisableVideoAndChat[] = "disable_video_chat"; // Whether Extensions are enabled. const char kDisableExtensions[] = "extensions.disabled"; -// Whether the plugin finder in the default plugin is enabled. +// Whether the plugin finder that lets you install missing plug-ins is enabled. const char kDisablePluginFinder[] = "plugins.disable_plugin_finder"; // Integer boolean representing the width (in pixels) of the container for diff --git a/chrome/default_plugin/DEPS b/chrome/default_plugin/DEPS deleted file mode 100644 index 3fa03c9..0000000 --- a/chrome/default_plugin/DEPS +++ /dev/null @@ -1,6 +0,0 @@ -include_rules = [ - "+grit", # For generated headers - "+libxml", - "+webkit/glue", - "+webkit/plugins", -] diff --git a/chrome/default_plugin/default_plugin.gyp b/chrome/default_plugin/default_plugin.gyp deleted file mode 100644 index 30aab78..0000000 --- a/chrome/default_plugin/default_plugin.gyp +++ /dev/null @@ -1,81 +0,0 @@ -# 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. - -{ - 'variables': { - 'chromium_code': 1, - }, - 'includes': [ - '../../build/win_precompile.gypi', - ], - 'targets': [ - { - 'target_name': 'default_plugin', - 'type': 'static_library', - 'dependencies': [ - ':default_plugin_resources', - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/net/net.gyp:net_resources', - '<(DEPTH)/third_party/icu/icu.gyp:icui18n', - '<(DEPTH)/third_party/icu/icu.gyp:icuuc', - '<(DEPTH)/third_party/libxml/libxml.gyp:libxml', - '<(DEPTH)/third_party/npapi/npapi.gyp:npapi', - '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources', - '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings', - ], - 'include_dirs': [ - '<(DEPTH)', - '<(DEPTH)/third_party/wtl/include', - ], - 'sources': [ - 'plugin_impl_win.cc', - 'plugin_impl_win.h', - 'plugin_installer_base.cc', - 'plugin_installer_base.h', - 'plugin_main.cc', - 'plugin_main.h', - ], - 'conditions': [ - ['OS=="win"', { - 'link_settings': { - 'libraries': ['-lurlmon.lib'], - }, - 'sources': [ - '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', - ], - }], - ['toolkit_uses_gtk == 1', { - 'dependencies': [ - '<(DEPTH)/build/linux/system.gyp:gtk', - ], - }], - ], - }, - # This can't be part of chrome.gyp:chrome_resources because then there'd - # be a cyclic dependency. - { - 'target_name': 'default_plugin_resources', - 'type': 'none', - 'variables': { - 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome/default_plugin_resources', - }, - 'actions': [ - { - 'action_name': 'default_plugin_resources', - 'variables': { - 'grit_grd_file': 'default_plugin_resources.grd', - }, - 'includes': [ '../../build/grit_action.gypi' ], - }, - ], - 'includes': [ '../../build/grit_target.gypi' ], - }, - ], -} diff --git a/chrome/default_plugin/default_plugin.ico b/chrome/default_plugin/default_plugin.ico Binary files differdeleted file mode 100644 index fa794a5..0000000 --- a/chrome/default_plugin/default_plugin.ico +++ /dev/null diff --git a/chrome/default_plugin/default_plugin_resources.grd b/chrome/default_plugin/default_plugin_resources.grd deleted file mode 100644 index f959220..0000000 --- a/chrome/default_plugin/default_plugin_resources.grd +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<grit latest_public_release="0" current_release="1"> - <outputs> - <output filename="grit/default_plugin_resources.h" type="rc_header"> - <emit emit_type='prepend'></emit> - </output> - <output filename="default_plugin_resources.pak" type="data_package" /> - <output filename="default_plugin_resources.rc" type="rc_all" /> - </outputs> - <release seq="1"> - <includes> - <!-- Medium-term, all the default plugin strings should be moved here. --> - <include name="IDR_PLUGIN_ICON" file="plugin_icon.png" type="BINDATA" /> - </includes> - </release> -</grit> diff --git a/chrome/default_plugin/default_plugin_resources.h b/chrome/default_plugin/default_plugin_resources.h deleted file mode 100644 index 6e6942c..0000000 --- a/chrome/default_plugin/default_plugin_resources.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2006-2008 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. - -#define IDD_DEFAULT_PLUGIN_INSTALL_DIALOG 2208 -#define IDI_DEFAULT_PLUGIN_ICON 2209 -#define IDB_GET_THE_PLUGIN 2210 -#define IDC_PLUGIN_MAIN_LABEL 2211 -#define IDC_PLUGIN_INSTALL_LABEL 2212 -#define IDC_PLUGIN_URL_LABEL 2213 -#define IDC_PLUGIN_INSTALL_CONFIRMATION_LABEL 2214 -#define IDC_PLUGIN_NAME 2215 -#define IDC_PLUGIN_NAME_VALUE 2216 diff --git a/chrome/default_plugin/default_plugin_resources.rc b/chrome/default_plugin/default_plugin_resources.rc deleted file mode 100644 index e857d84..0000000 --- a/chrome/default_plugin/default_plugin_resources.rc +++ /dev/null @@ -1,31 +0,0 @@ -// Resources used by webkit/default_plugin. -// -// Paths in this file are relative to SolutionDir. - -#ifdef APSTUDIO_INVOKED - #error // Don't open in the Visual Studio resource editor! -#endif //APSTUDIO_INVOKED - -#include <winuser.h> -#include "chrome\\default_plugin\\default_plugin_resources.h" - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog template for the plugin installation dialog. -// -IDD_DEFAULT_PLUGIN_INSTALL_DIALOG DIALOGEX 0, 0, 240, 130 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Plug-in Needed" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "",IDB_GET_THE_PLUGIN,32,100,81,14 - PUSHBUTTON "",IDCANCEL,133,100,74,14 - LTEXT "",IDC_PLUGIN_INSTALL_CONFIRMATION_LABEL,17,50,204,27 -END - -///////////////////////////////////////////////////////////////////////////// -// -// Icon used by the default plugin window. -// -IDI_DEFAULT_PLUGIN_ICON ICON "chrome\\default_plugin\\default_plugin.ico" diff --git a/chrome/default_plugin/install_dialog.cc b/chrome/default_plugin/install_dialog.cc deleted file mode 100644 index 0ae91cf..0000000 --- a/chrome/default_plugin/install_dialog.cc +++ /dev/null @@ -1,204 +0,0 @@ -// 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 "chrome/default_plugin/install_dialog.h" - -#include "base/hash_tables.h" -#include "base/lazy_instance.h" -#include "base/logging.h" -#include "base/string_util.h" -#include "chrome/default_plugin/plugin_impl.h" -#include "grit/webkit_strings.h" -#include "ui/base/l10n/l10n_util.h" -#include "webkit/glue/webkit_glue.h" - -typedef base::hash_map<const std::wstring, PluginInstallDialog*> DialogMap; -base::LazyInstance<DialogMap> s_dialogs = LAZY_INSTANCE_INITIALIZER; - -PluginInstallDialog* PluginInstallDialog::AddInstaller( - PluginInstallerImpl* plugin_impl, const std::wstring& plugin_name) { - PluginInstallDialog* dialog; - if (s_dialogs.Get().count(plugin_name)) { - dialog = s_dialogs.Get()[plugin_name]; - } else { - dialog = new PluginInstallDialog(plugin_name); - } - - dialog->installers_.push_back(plugin_impl); - return dialog; -} - -PluginInstallDialog::PluginInstallDialog(const std::wstring& plugin_name) - : plugin_name_(plugin_name) { - s_dialogs.Get()[plugin_name] = this; -} - -PluginInstallDialog::~PluginInstallDialog() { - s_dialogs.Get().erase(plugin_name_); - if (IsWindow()) - DestroyWindow(); -} - -void PluginInstallDialog::RemoveInstaller(PluginInstallerImpl* installer) { - for (size_t i = 0; i < installers_.size(); ++i) { - if (installers_[i] == installer) { - installers_.erase(installers_.begin() + i); - if (installers_.empty()) - delete this; - return; - } - } - NOTREACHED(); -} - -void PluginInstallDialog::ShowInstallDialog(HWND parent) { - if (IsWindow()) - return; - - Create(parent, NULL); - ShowWindow(SW_SHOW); -} - -HWND PluginInstallDialog::Create(HWND parent_window, LPARAM init_param) { - // Most of the code here is based on CDialogImpl<T>::Create. - DCHECK(m_hWnd == NULL); - - // Allocate the thunk structure here, where we can fail - // gracefully. - BOOL thunk_inited = m_thunk.Init(NULL, NULL); - if (thunk_inited == FALSE) { - SetLastError(ERROR_OUTOFMEMORY); - return NULL; - } - - _AtlWinModule.AddCreateWndData(&m_thunk.cd, this); - -#ifndef NDEBUG - m_bModal = false; -#endif // NDEBUG - - HINSTANCE instance_handle = _AtlBaseModule.GetResourceInstance(); - - HRSRC dialog_resource = FindResource(instance_handle, - MAKEINTRESOURCE(IDD), RT_DIALOG); - if (!dialog_resource) { - NOTREACHED(); - return NULL; - } - - HGLOBAL dialog_template = LoadResource(instance_handle, - dialog_resource); - if (!dialog_template) { - NOTREACHED(); - return NULL; - } - - _DialogSplitHelper::DLGTEMPLATEEX* dialog_template_struct = - reinterpret_cast<_DialogSplitHelper::DLGTEMPLATEEX *>( - ::LockResource(dialog_template)); - DCHECK(dialog_template_struct != NULL); - - unsigned long dialog_template_size = - SizeofResource(instance_handle, dialog_resource); - - HGLOBAL rtl_layout_dialog_template = NULL; - - if (PluginInstallerImpl::IsRTLLayout()) { - rtl_layout_dialog_template = GlobalAlloc(GPTR, dialog_template_size); - DCHECK(rtl_layout_dialog_template != NULL); - - _DialogSplitHelper::DLGTEMPLATEEX* rtl_layout_dialog_template_struct = - reinterpret_cast<_DialogSplitHelper::DLGTEMPLATEEX*>( - ::GlobalLock(rtl_layout_dialog_template)); - DCHECK(rtl_layout_dialog_template_struct != NULL); - - memcpy(rtl_layout_dialog_template_struct, dialog_template_struct, - dialog_template_size); - - rtl_layout_dialog_template_struct->exStyle |= - (WS_EX_LAYOUTRTL | WS_EX_RTLREADING); - - dialog_template_struct = rtl_layout_dialog_template_struct; - } - - HWND dialog_window = - CreateDialogIndirectParam( - instance_handle, - reinterpret_cast<DLGTEMPLATE*>(dialog_template_struct), - parent_window, StartDialogProc, init_param); - - DCHECK(m_hWnd == dialog_window); - - if (rtl_layout_dialog_template) { - GlobalUnlock(rtl_layout_dialog_template); - GlobalFree(rtl_layout_dialog_template); - } - - return dialog_window; -} - - -LRESULT PluginInstallDialog::OnInitDialog(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) { - std::wstring dialog_title = - PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement( - IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE, - IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE_NO_PLUGIN_NAME, - plugin_name_); - AdjustTextDirectionality(&dialog_title); - SetWindowText(dialog_title.c_str()); - - std::wstring get_the_plugin_btn_msg = - l10n_util::GetStringUTF16( - IDS_DEFAULT_PLUGIN_GET_THE_PLUGIN_BTN_MSG); - AdjustTextDirectionality(&get_the_plugin_btn_msg); - SetDlgItemText(IDB_GET_THE_PLUGIN, get_the_plugin_btn_msg.c_str()); - - std::wstring cancel_plugin_download_msg = - l10n_util::GetStringUTF16( - IDS_DEFAULT_PLUGIN_CANCEL_PLUGIN_DOWNLOAD_MSG); - AdjustTextDirectionality(&cancel_plugin_download_msg); - SetDlgItemText(IDCANCEL, cancel_plugin_download_msg.c_str()); - - std::wstring plugin_user_action_msg = - PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement( - IDS_DEFAULT_PLUGIN_USER_OPTION_MSG, - IDS_DEFAULT_PLUGIN_USER_OPTION_MSG_NO_PLUGIN_NAME, - plugin_name_); - AdjustTextDirectionality(&plugin_user_action_msg); - SetDlgItemText(IDC_PLUGIN_INSTALL_CONFIRMATION_LABEL, - plugin_user_action_msg.c_str()); - return 0; -} - - -LRESULT PluginInstallDialog::OnGetPlugin(WORD notify_code, WORD id, - HWND wnd_ctl, BOOL &handled) { - DestroyWindow(); - if (!installers_.empty()) - installers_[0]->DownloadPlugin(); - - return 0; -} - -LRESULT PluginInstallDialog::OnCancel(WORD notify_code, WORD id, HWND wnd_ctl, - BOOL &handled) { - DestroyWindow(); - if (!installers_.empty()) - installers_[0]->DownloadCancelled(); - return 0; -} - -// TODO(idana) bug# 1246452: use the library l10n_util once it is moved from -// the Chrome module into the Base module. For now, we simply copy/paste the -// same code. -void PluginInstallDialog::AdjustTextDirectionality(std::wstring* text) const { - if (PluginInstallerImpl::IsRTLLayout()) { - // Inserting an RLE (Right-To-Left Embedding) mark as the first character. - text->insert(0, L"\x202B"); - - // Inserting a PDF (Pop Directional Formatting) mark as the last character. - text->append(L"\x202C"); - } -} diff --git a/chrome/default_plugin/install_dialog.h b/chrome/default_plugin/install_dialog.h deleted file mode 100644 index 5e160f2..0000000 --- a/chrome/default_plugin/install_dialog.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2006-2008 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_DEFAULT_PLUGIN_INSTALL_DIALOG_H_ -#define CHROME_DEFAULT_PLUGIN_INSTALL_DIALOG_H_ -#pragma once - -#include <atlbase.h> -#include <atlwin.h> -#include <string> -#include <vector> - -#include "chrome/default_plugin/default_plugin_resources.h" - -class PluginInstallerImpl; - -// Displays the plugin installation dialog containing information -// about the mime type of the plugin being downloaded, the URL -// where it would be downloaded from, etc. -class PluginInstallDialog : public CDialogImpl<PluginInstallDialog> { - public: - enum {IDD = IDD_DEFAULT_PLUGIN_INSTALL_DIALOG}; - - BEGIN_MSG_MAP(PluginInstallDialog) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_ID_HANDLER(IDB_GET_THE_PLUGIN, OnGetPlugin) - COMMAND_ID_HANDLER(IDCANCEL, OnCancel) - END_MSG_MAP() - - // Creates or returns the existing object for the given plugin name. - // Call RemoveInstaller when done. - static PluginInstallDialog* AddInstaller(PluginInstallerImpl* plugin_impl, - const std::wstring& plugin_name); - - // Lets this object know that the given installer object is going away. - void RemoveInstaller(PluginInstallerImpl* installer); - - void ShowInstallDialog(HWND parent); - - private: - explicit PluginInstallDialog(const std::wstring& plugin_name); - ~PluginInstallDialog(); - - // Implemented to ensure that we handle RTL layouts correctly. - HWND Create(HWND parent_window, LPARAM init_param); - - LRESULT OnInitDialog(UINT message, WPARAM wparam, LPARAM lparam, - BOOL& handled); - LRESULT OnGetPlugin(WORD notify_code, WORD id, HWND wnd_ctl, BOOL &handled); - LRESULT OnCancel(WORD notify_code, WORD id, HWND wnd_ctl, BOOL &handled); - - // Wraps the string with Unicode directionality characters in order to make - // sure BiDi text is rendered correctly when the UI layout is right-to-left. - void AdjustTextDirectionality(std::wstring* text) const; - - std::vector<PluginInstallerImpl*> installers_; - std::wstring plugin_name_; -}; - -#endif // CHROME_DEFAULT_PLUGIN_INSTALL_DIALOG_H_ diff --git a/chrome/default_plugin/plugin_database_handler.cc b/chrome/default_plugin/plugin_database_handler.cc deleted file mode 100644 index d2659319..0000000 --- a/chrome/default_plugin/plugin_database_handler.cc +++ /dev/null @@ -1,358 +0,0 @@ -// 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. - -// For WinDDK ATL compatibility, these ATL headers must come first. -#include <atlbase.h> -#include <atlwin.h> - -#include "chrome/default_plugin/plugin_database_handler.h" - -#include "libxml/parser.h" -#include "libxml/xpath.h" - -#include "base/file_util.h" -#include "base/path_service.h" -#include "base/string_number_conversions.h" -#include "base/string_split.h" -#include "base/string_util.h" -#include "base/time.h" -#include "base/utf_string_conversions.h" -#include "chrome/default_plugin/plugin_impl.h" -#include "chrome/default_plugin/plugin_main.h" - -using base::Time; -using base::TimeDelta; - -PluginDatabaseHandler::PluginDatabaseHandler( - PluginInstallerImpl& plugin_installer_instance) - : plugin_downloads_file_(INVALID_HANDLE_VALUE), - plugin_installer_instance_(plugin_installer_instance), - ignore_plugin_db_data_(false) { -} - -PluginDatabaseHandler::~PluginDatabaseHandler() { - if (plugin_downloads_file_ != INVALID_HANDLE_VALUE) { - ::CloseHandle(plugin_downloads_file_); - plugin_downloads_file_ = INVALID_HANDLE_VALUE; - } -} - -bool PluginDatabaseHandler::DownloadPluginsFileIfNeeded( - const std::string& plugin_finder_url) { - DCHECK(!plugin_finder_url.empty()); - // The time in days for which the plugins list is cached. - // TODO(iyengar) Make this configurable. - const int kPluginsListCacheTimeInDays = 3; - - plugin_finder_url_ = plugin_finder_url; - - FilePath module_path; - PathService::Get(base::DIR_MODULE, &module_path); - plugins_file_ = module_path.Append(L"chrome_plugins_file.xml").value(); - - bool initiate_download = false; - if (!file_util::PathExists(FilePath(plugins_file_))) { - initiate_download = true; - } else { - SYSTEMTIME creation_system_time = {0}; - if (!file_util::GetFileCreationLocalTime(plugins_file_, - &creation_system_time)) { - NOTREACHED(); - return false; - } - - FILETIME creation_file_time = {0}; - ::SystemTimeToFileTime(&creation_system_time, &creation_file_time); - - FILETIME current_time = {0}; - ::GetSystemTimeAsFileTime(¤t_time); - - Time file_time = Time::FromFileTime(creation_file_time); - Time current_system_time = Time::FromFileTime(current_time); - - TimeDelta time_diff = file_time - current_system_time; - if (time_diff.InDays() > kPluginsListCacheTimeInDays) { - initiate_download = true; - } - } - - if (initiate_download) { - DVLOG(1) << "Initiating GetURLNotify on the plugin finder URL " - << plugin_finder_url.c_str(); - - plugin_installer_instance_.set_plugin_installer_state( - PluginListDownloadInitiated); - - DCHECK(default_plugin::g_browser->geturlnotify); - default_plugin::g_browser->geturlnotify( - plugin_installer_instance_.instance(), plugin_finder_url.c_str(), - NULL, NULL); - } else { - DVLOG(1) << "Plugins file " << plugins_file_ << " already exists"; - plugin_downloads_file_ = ::CreateFile(plugins_file_.c_str(), GENERIC_READ, - FILE_SHARE_READ, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { - DVLOG(1) << "Failed to open plugins file " << plugins_file_ - << " Error " << ::GetLastError(); - NOTREACHED(); - return false; - } - // The URLNotify function contains all handling needed to parse the plugins - // file and display the UI accordingly. - plugin_installer_instance_.set_plugin_installer_state( - PluginListDownloadInitiated); - plugin_installer_instance_.URLNotify(plugin_finder_url.c_str(), - NPRES_DONE); - } - return true; -} - -int32 PluginDatabaseHandler::Write(NPStream* stream, int32 offset, - int32 buffer_length, void* buffer) { - if (ignore_plugin_db_data_) { - return buffer_length; - } - - if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { - DVLOG(1) << "About to create plugins file " << plugins_file_; - plugin_downloads_file_ = CreateFile(plugins_file_.c_str(), - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ, NULL, CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, NULL); - if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { - DWORD error = ::GetLastError(); - if (error == ERROR_SHARING_VIOLATION) { - // File may have been downloaded by another plugin instance on this - // page. - plugin_downloads_file_ = ::CreateFile( - plugins_file_.c_str(), GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - if (plugin_downloads_file_ != INVALID_HANDLE_VALUE) { - ignore_plugin_db_data_ = true; - return buffer_length; - } - } - - DLOG(ERROR) << "Failed to create plugins file " << plugins_file_ - << " Error " << ::GetLastError(); - return 0; - } - } - - DWORD bytes_written = 0; - if (0 == lstrcmpiA(stream->url, plugin_finder_url_.c_str())) { - DCHECK(plugin_downloads_file_ != INVALID_HANDLE_VALUE); - - WriteFile(plugin_downloads_file_, buffer, buffer_length, &bytes_written, - NULL); - DCHECK_EQ(buffer_length, static_cast<int32>(bytes_written)); - } - return bytes_written; -} - - -bool PluginDatabaseHandler::ParsePluginList() { - if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { - DLOG(WARNING) << "Invalid plugins file"; - NOTREACHED(); - return false; - } - - bool parse_result = false; - - std::string plugins_file = WideToUTF8(plugins_file_.c_str()); - xmlDocPtr plugin_downloads_doc = xmlParseFile(plugins_file.c_str()); - if (plugin_downloads_doc == NULL) { - DLOG(WARNING) << "Failed to parse plugins file " << plugins_file.c_str(); - return parse_result; - } - - xmlXPathContextPtr context = NULL; - xmlXPathObjectPtr plugins_result = NULL; - - do { - context = xmlXPathNewContext(plugin_downloads_doc); - if (context == NULL) { - DLOG(WARNING) << "Failed to retrieve XPath context"; - NOTREACHED(); - parse_result = false; - break; - } - - plugins_result = - xmlXPathEvalExpression(reinterpret_cast<const xmlChar*>("//plugin"), - context); - if ((plugins_result == NULL) || - xmlXPathNodeSetIsEmpty(plugins_result->nodesetval)) { - DLOG(WARNING) << "Failed to find XPath //plugin"; - NOTREACHED(); - parse_result = false; - break; - } - - xmlNodeSetPtr plugin_list = plugins_result->nodesetval; - for (int plugin_index = 0; plugin_index < plugin_list->nodeNr; - ++plugin_index) { - PluginDetail plugin_detail; - if (!ReadPluginInfo(plugin_list->nodeTab[plugin_index]->children, - &plugin_detail)) { - DLOG(ERROR) << "Failed to read plugin details at index " - << plugin_index; - break; - } - downloaded_plugins_list_.push_back(plugin_detail); - } - if (downloaded_plugins_list_.size()) - parse_result = true; - } while (0); - - xmlXPathFreeContext(context); - xmlXPathFreeObject(plugins_result); - xmlFreeDoc(plugin_downloads_doc); - xmlCleanupParser(); - DVLOG(1) << "Parse plugins file result " << parse_result; - return parse_result; -} - -bool PluginDatabaseHandler::GetPluginDetailsForMimeType( - const char* mime_type, const char* language, - std::string* download_url, std::wstring* plugin_name, - bool* download_url_for_display) { - if (!mime_type || !language || !download_url || !plugin_name || - !download_url_for_display) { - NOTREACHED(); - return false; - } - - PluginList::iterator plugin_index; - for (plugin_index = downloaded_plugins_list_.begin(); - plugin_index != downloaded_plugins_list_.end(); - ++plugin_index) { - PluginDetail& current_plugin = *plugin_index; - - std::vector<std::string>::iterator mime_type_index; - for (mime_type_index = current_plugin.mime_types.begin(); - mime_type_index != current_plugin.mime_types.end(); - ++mime_type_index) { - if ((0 == lstrcmpiA(mime_type, (*mime_type_index).c_str())) && - (0 == lstrcmpiA(language, current_plugin.language.c_str()))) { - *download_url = current_plugin.download_url; - *plugin_name = current_plugin.display_name; - *download_url_for_display = current_plugin.download_url_for_display; - return true; - } - } - } - return false; -} - -void PluginDatabaseHandler::Close(bool delete_file) { - if (plugin_downloads_file_ != INVALID_HANDLE_VALUE) { - ::CloseHandle(plugin_downloads_file_); - plugin_downloads_file_ = INVALID_HANDLE_VALUE; - if (delete_file) { - ::DeleteFile(plugins_file_.c_str()); - plugins_file_.clear(); - } - } -} - -bool PluginDatabaseHandler::ReadPluginInfo(_xmlNode* plugin_node, - PluginDetail* plugin_detail) { - static const char kMimeTypeSeparator = ';'; - - if (!plugin_node) { - NOTREACHED(); - return false; - } - - _xmlNode* plugin_mime_type = plugin_node->next; - if ((plugin_mime_type == NULL) || - (plugin_mime_type->next == NULL)) { - DLOG(WARNING) << "Failed to find mime type node in file"; - NOTREACHED(); - return false; - } - _xmlNode* plugin_mime_type_vals = plugin_mime_type->children; - if (plugin_mime_type_vals == NULL) { - DLOG(WARNING) << "Invalid mime type"; - NOTREACHED(); - return false; - } - // Skip the first child of each node as it is the text element - // for that node. - _xmlNode* plugin_lang_node = plugin_mime_type->next->next; - if ((plugin_lang_node == NULL) || - (plugin_lang_node->next == NULL)) { - DLOG(WARNING) << "Failed to find plugin language node"; - NOTREACHED(); - return false; - } - _xmlNode* plugin_lang_val = plugin_lang_node->children; - if (plugin_lang_val == NULL) { - DLOG(WARNING) << "Invalid plugin language"; - NOTREACHED(); - return false; - } - _xmlNode* plugin_name_node = plugin_lang_node->next->next; - if ((plugin_name_node == NULL) || - (plugin_name_node->next == NULL)) { - DLOG(WARNING) << "Failed to find plugin name node"; - NOTREACHED(); - return false; - } - _xmlNode* plugin_name_val = plugin_name_node->children; - if (plugin_name_val == NULL) { - DLOG(WARNING) << "Invalid plugin name"; - NOTREACHED(); - return false; - } - _xmlNode* plugin_download_url_node = plugin_name_node->next->next; - if (plugin_download_url_node == NULL) { - DLOG(WARNING) << "Failed to find plugin URL node"; - NOTREACHED(); - return false; - } - _xmlNode* plugin_download_url_val = plugin_download_url_node->children; - if (plugin_download_url_val == NULL) { - DLOG(WARNING) << "Invalid plugin URL"; - NOTREACHED(); - return false; - } - - // Look for the DisplayUrl node. By default every URL is treated as an - // executable URL. - plugin_detail->download_url_for_display = false; - - _xmlNode* plugin_download_url_for_display_node = - plugin_download_url_node->next->next; - if (plugin_download_url_for_display_node) { - _xmlNode* url_for_display_val = - plugin_download_url_for_display_node->children; - if (url_for_display_val) { - int url_for_display = 0; - base::StringToInt( - reinterpret_cast<const char*>(url_for_display_val->content), - &url_for_display); - if (url_for_display != 0) - plugin_detail->download_url_for_display = true; - } - } - - plugin_detail->display_name = - UTF8ToWide(reinterpret_cast<const char*>(plugin_name_val->content)); - plugin_detail->download_url = - reinterpret_cast<const char*>(plugin_download_url_val->content); - - base::SplitString( - reinterpret_cast<const char*>(plugin_mime_type_vals->content), - kMimeTypeSeparator, &plugin_detail->mime_types); - - plugin_detail->language = - reinterpret_cast<const char*>(plugin_lang_val->content); - - return true; -} diff --git a/chrome/default_plugin/plugin_database_handler.h b/chrome/default_plugin/plugin_database_handler.h deleted file mode 100644 index 1f12745..0000000 --- a/chrome/default_plugin/plugin_database_handler.h +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) 2006-2008 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_DEFAULT_PLUGIN_PLUGIN_DATABASE_HANDLER_H_ -#define CHROME_DEFAULT_PLUGIN_PLUGIN_DATABASE_HANDLER_H_ -#pragma once - -#include <windows.h> -#include <string> -#include <vector> - -#include "base/basictypes.h" -#include "third_party/npapi/bindings/npapi.h" - -// Individual plugin details -struct PluginDetail { - // List of mime types supported by the plugin. - std::vector<std::string> mime_types; - // The URL where the plugin can be downloaded from. - std::string download_url; - // The display name for the plugin. - std::wstring display_name; - // Language of the plugin installer. (en-us, etc). - std::string language; - // Indicates if the download URL points to an exe or to a URL which - // needs to be displayed in a tab. - bool download_url_for_display; -}; - -typedef std::vector<PluginDetail> PluginList; - -class PluginInstallerImpl; -struct _xmlNode; - -// This class handles download of the plugins database file from the plugin -// finder URL passed in. It also provides functionality to parse the plugins -// file and to locate the desired plugin mime type in the parsed plugin list. -// The format of the plugins databse file is as below:- -// <plugins> -// <plugin> -// <mime_types> </mime_types> (semicolon separated list of mime types -// supported by the plugin) -// <lang> </lang> (Supported language) -// <url> </url> (Link to the plugin installer) -// <displayurl> 0 </displayurl> (Indicates if the URL is a display URL. -// defaults to 0. -// </plugin> -// <plugin> -// </plugins> -class PluginDatabaseHandler { - public: - // plugin_installer_instance is a reference maintained to the current - // PluginInstallerImpl instance. - explicit PluginDatabaseHandler( - PluginInstallerImpl& plugin_installer_instance); - - virtual ~PluginDatabaseHandler(); - - // Downloads the plugins database file if needed. - // - // Parameters: - // plugin_finder_url - // Specifies the http/https location of the chrome plugin finder. - // Returns true on success. - bool DownloadPluginsFileIfNeeded(const std::string& plugin_finder_url); - - // Writes data to the plugins database file. - // - // Parameters: - // stream - // Pointer to the current stream. - // offset - // Indicates the data offset. - // buffer_length - // Specifies 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); - - const std::wstring& plugins_file() const { - return plugins_file_; - } - - // Parses the XML file containing the list of available third-party - // plugins and adds them to a list. - // Returns true on success - bool ParsePluginList(); - - // Returns the plugin details for the third party plugin mime type passed in. - // - // Parameters: - // mime_type - // Specifies the mime type of the desired third party plugin. - // language - // Specifies the desired plugin language. - // download_url - // Output parameter which contans the plugin download URL on success. - // display_name - // Output parameter which contains the display name of the plugin on - // success. - // download_url_for_display - // Output parameter which indicates if the plugin URL points to an exe - // or not. - // Returns true if the plugin details were found. - bool GetPluginDetailsForMimeType(const char* mime_type, - const char* language, - std::string* download_url, - std::wstring* display_name, - bool* download_url_for_display); - - // Closes the handle to the plugin database file. - // - // Parameters: - // delete_file - // Indicates if the plugin database file should be deleted. - void Close(bool delete_file); - - protected: - // Reads plugin information off an individual XML node. - // - // Parameters: - // plugin_node - // Pointer to the plugin XML node. - // plugin_detail - // Output parameter which contains the details of the plugin on success. - // Returns true on success. - bool ReadPluginInfo(_xmlNode* plugin_node, PluginDetail* plugin_detail); - - private: - // Contains the full path of the downloaded plugins file containing - // information about available third party plugin downloads. - std::wstring plugins_file_; - // Handle to the downloaded plugins file. - HANDLE plugin_downloads_file_; - // List of downloaded plugins. This is generated the first time the - // plugins file is downloaded and parsed. Each item in the list is - // of the type PluginDetail, and contains information about the third - // party plugin like it's mime type, download link, etc. - PluginList downloaded_plugins_list_; - // We maintain a reference to the PluginInstallerImpl instance to be able - // to achieve plugin installer state changes and to notify the instance - // about download completions. - PluginInstallerImpl& plugin_installer_instance_; - // The plugin finder url - std::string plugin_finder_url_; - // Set if the current instance should ignore plugin data. This is required - // if multiple null plugin instances attempt to download the plugin - // database. In this case the first instance to create the plugins database - // file locally writes to the file. The remaining instances ignore the - // downloaded data. - bool ignore_plugin_db_data_; -}; - -#endif // CHROME_DEFAULT_PLUGIN_PLUGIN_DATABASE_HANDLER_H_ diff --git a/chrome/default_plugin/plugin_icon.png b/chrome/default_plugin/plugin_icon.png Binary files differdeleted file mode 100644 index d184738..0000000 --- a/chrome/default_plugin/plugin_icon.png +++ /dev/null diff --git a/chrome/default_plugin/plugin_impl.h b/chrome/default_plugin/plugin_impl.h deleted file mode 100644 index 845c0d5..0000000 --- a/chrome/default_plugin/plugin_impl.h +++ /dev/null @@ -1,7 +0,0 @@ -// 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. - -#if defined(OS_WIN) -#include "chrome/default_plugin/plugin_impl_win.h" -#endif diff --git a/chrome/default_plugin/plugin_impl_win.cc b/chrome/default_plugin/plugin_impl_win.cc deleted file mode 100644 index 0b7043a..0000000 --- a/chrome/default_plugin/plugin_impl_win.cc +++ /dev/null @@ -1,688 +0,0 @@ -// 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 "chrome/default_plugin/plugin_impl_win.h" - -#include <shellapi.h> - -#include "base/file_util.h" -#include "base/path_service.h" -#include "base/string_util.h" -#include "base/utf_string_conversions.h" -#include "chrome/common/chrome_plugin_messages.h" -#include "chrome/default_plugin/plugin_main.h" -#include "content/common/child_thread.h" -#include "content/common/plugin_messages.h" -#include "googleurl/src/gurl.h" -#include "grit/webkit_strings.h" -#include "net/base/net_errors.h" -#include "ui/base/l10n/l10n_util.h" -#include "unicode/locid.h" -#include "webkit/glue/webkit_glue.h" -#include "webkit/plugins/npapi/default_plugin_shared.h" - -static const int TOOLTIP_MAX_WIDTH = 500; - -int PluginInstallerImpl::instance_count_ = 0; -bool PluginInstallerImpl::show_install_infobar_ = true; - -PluginInstallerImpl::PluginInstallerImpl(int16 mode) - : instance_(NULL), - mode_(mode), - disable_plugin_finder_(false), - plugin_install_stream_(NULL), - plugin_installer_state_(PluginInstallerStateUndefined), - install_dialog_(NULL), - enable_click_(false), - icon_(NULL), - bold_font_(NULL), - regular_font_(NULL), - underline_font_(NULL), - tooltip_(NULL), - installation_job_monitor_thread_( - new PluginInstallationJobMonitorThread()), - plugin_database_handler_(*this), - plugin_download_url_for_display_(false) { - instance_count_++; -} - -PluginInstallerImpl::~PluginInstallerImpl() { - instance_count_--; - if (instance_count_ == 0) - show_install_infobar_ = true; - - if (!disable_plugin_finder_) - installation_job_monitor_thread_->Stop(); - - if (bold_font_) - DeleteObject(bold_font_); - - if (underline_font_) - DeleteObject(underline_font_); - - if (tooltip_) - DestroyWindow(tooltip_); -} - -bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance, - NPMIMEType mime_type, int16 argc, - char* argn[], char* argv[]) { - DVLOG(1) << __FUNCTION__ << " MIME Type : " << mime_type; - DCHECK(instance != NULL); - DCHECK(module_handle != NULL); - - if (mime_type == NULL || strlen(mime_type) == 0) { - NOTREACHED() << __FUNCTION__ << " Invalid parameters passed in"; - return false; - } - - instance_ = instance; - mime_type_ = mime_type; - - ChildThread::current()->Send( - new ChromePluginProcessHostMsg_GetPluginFinderUrl(&plugin_finder_url_)); - if (plugin_finder_url_.empty()) - disable_plugin_finder_ = true; - - InitializeResources(module_handle); - - // Set the routing IDs before downloading the plug-in file, so we can - // immediately notify the browser if a plug-in is available. - PluginInstallerBase::SetRoutingIds(argc, argn, argv); - if (!disable_plugin_finder_) { - if (!installation_job_monitor_thread_->Initialize()) { - NOTREACHED() << "Failed to initialize plugin install job"; - return false; - } - - DisplayStatus(IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_NO_PLUGIN_NAME); - plugin_database_handler_.DownloadPluginsFileIfNeeded(plugin_finder_url_); - } else { - DisplayStatus(IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_PLUGIN_FINDER_DISABLED); - } - return true; -} - -void PluginInstallerImpl::Shutdown() { - if (install_dialog_) { - install_dialog_->RemoveInstaller(this); - install_dialog_ = NULL; - } - - if (IsWindow(hwnd())) { - DestroyWindow(hwnd()); - } -} - -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; - - if (plugin_installer_state() != PluginListDownloadInitiated) { - DCHECK(default_plugin::g_browser); - DCHECK(default_plugin::g_browser->destroystream); - // We don't want any data, kill the stream. - default_plugin::g_browser->destroystream(instance_, stream, NPRES_DONE); - } - if (0 == lstrcmpiA(stream->url, plugin_finder_url_.c_str())) { - ready_to_accept_data = true; - } - return ready_to_accept_data; -} - -int32 PluginInstallerImpl::Write(NPStream* stream, int32 offset, - int32 buffer_length, void* buffer) { - if (plugin_installer_state() != PluginListDownloadInitiated) { - DCHECK(default_plugin::g_browser); - DCHECK(default_plugin::g_browser->destroystream); - // We don't want any data, kill the stream. - default_plugin::g_browser->destroystream(instance_, stream, NPRES_DONE); - return 0; - } - - return plugin_database_handler_.Write(stream, offset, buffer_length, buffer); -} - -void PluginInstallerImpl::ClearDisplay() { - enable_click_ = false; - command_.clear(); - optional_additional_message_.clear(); - get_plugin_link_message_.clear(); -} - -void PluginInstallerImpl::RefreshDisplay() { - if (!IsWindow(hwnd())) - return; - UpdateToolTip(); - - InvalidateRect(hwnd(), NULL, TRUE); - UpdateWindow(hwnd()); -} - -bool PluginInstallerImpl::CreateToolTip() { - DWORD ex_styles = IsRTLLayout() ? WS_EX_LAYOUTRTL : 0; - tooltip_ = CreateWindowEx(ex_styles, TOOLTIPS_CLASS, NULL, - WS_POPUP | TTS_ALWAYSTIP, - CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, - hwnd(), NULL, NULL, NULL); - if (!tooltip_) - return false; - - // Associate the ToolTip with the tool. - TOOLINFO tool_info = {0}; - tool_info.cbSize = sizeof(tool_info); - tool_info.hwnd = hwnd(); - tool_info.uFlags = TTF_IDISHWND | TTF_SUBCLASS; - tool_info.uId = reinterpret_cast<UINT_PTR>(hwnd()); - tool_info.lpszText = NULL; - SendMessage(tooltip_, TTM_ADDTOOL, 0, reinterpret_cast<LPARAM>(&tool_info)); - SendMessage(tooltip_, TTM_SETMAXTIPWIDTH, 0, TOOLTIP_MAX_WIDTH); - return true; -} - -void PluginInstallerImpl::UpdateToolTip() { - if (tooltip_ == NULL) - return; - std::wstring tip = command_; - if (!optional_additional_message_.empty()) - tip += std::wstring(L"\n\r") + optional_additional_message_; - - TOOLINFO tool_info = {0}; - tool_info.cbSize = sizeof(tool_info); - tool_info.hwnd = hwnd(); - tool_info.uFlags = TTF_IDISHWND; - tool_info.uId = reinterpret_cast<UINT_PTR>(hwnd()); - tool_info.lpszText = const_cast<LPWSTR>(tip.c_str()); - SendMessage(tooltip_, TTM_UPDATETIPTEXT, 0, (LPARAM)&tool_info); -} - -void PluginInstallerImpl::DisplayAvailablePluginStatus() { - ClearDisplay(); - enable_click_ = true; - command_ = ReplaceStringForPossibleEmptyReplacement( - IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG, - IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_NO_PLUGIN_NAME, - plugin_name_); - optional_additional_message_ = - l10n_util::GetStringUTF16(IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_2); - get_plugin_link_message_ = l10n_util::GetStringUTF16( - IDS_DEFAULT_PLUGIN_GET_THE_PLUGIN_BTN_MSG); - RefreshDisplay(); -} - -void PluginInstallerImpl::DisplayStatus(int message_resource_id) { - ClearDisplay(); - command_ = - l10n_util::GetStringUTF16(message_resource_id); - RefreshDisplay(); -} - -void PluginInstallerImpl::DisplayPluginDownloadFailedStatus() { - ClearDisplay(); - command_ = l10n_util::GetStringUTF16( - IDS_DEFAULT_PLUGIN_DOWNLOAD_FAILED_MSG); - command_ = ReplaceStringPlaceholders( - command_, - ASCIIToWide(plugin_download_url_), - NULL); - RefreshDisplay(); -} - -void PluginInstallerImpl::URLNotify(const char* url, NPReason reason) { - DCHECK(plugin_installer_state_ == PluginListDownloadInitiated); - - if (plugin_installer_state_ == PluginListDownloadInitiated) { - bool plugin_available = false; - if (reason == NPRES_DONE) { - DVLOG(1) << "Received Done notification for plugin list download"; - plugin_database_handler_.ParsePluginList(); - if (plugin_database_handler_.GetPluginDetailsForMimeType( - mime_type_.c_str(), desired_language_.c_str(), - &plugin_download_url_, &plugin_name_, - &plugin_download_url_for_display_)) { - plugin_available = true; - install_dialog_ = PluginInstallDialog::AddInstaller(this, plugin_name_); - set_plugin_installer_state(PluginListDownloaded); - } else { - set_plugin_installer_state(PluginListDownloadedPluginNotFound); - } - - plugin_database_handler_.Close(false); - } else { - DLOG(WARNING) << "Failed to download plugin list"; - set_plugin_installer_state(PluginListDownloadFailed); - - plugin_database_handler_.Close(true); - } - - if (plugin_available) { - DVLOG(1) << "Plugin available for mime type " << mime_type_; - NotifyPluginStatus( - webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE); - DisplayAvailablePluginStatus(); - } else { - DLOG(WARNING) << "No plugin available for mime type " << mime_type_; - DisplayStatus(IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG); - } - } -} - -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) { - // If the replacement_string is not empty, load the string identified by - // the resource id message_id_with_placeholders, and replace the - // placeholder with the replacement_string. Otherwise return the string - // identified by resource id messsage_id_without_placeholders. - if (replacement_string.empty()) { - return l10n_util::GetStringUTF16(messsage_id_without_placeholders); - } else { - std::wstring string_with_placeholders = - l10n_util::GetStringUTF16(message_id_with_placeholders); - return ReplaceStringPlaceholders(string_with_placeholders, - replacement_string, NULL); - } -} - -bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { - HWND parent_window = reinterpret_cast<HWND>(window_info->window); - if (!IsWindow(parent_window)) { - // No window created yet. Ignore this call. - if (!IsWindow(hwnd())) - return true; - // Parent window has been destroyed. - Shutdown(); - return true; - } - - RECT parent_rect = {0}; - - if (IsWindow(hwnd())) { - GetClientRect(parent_window, &parent_rect); - SetWindowPos(hwnd(), NULL, parent_rect.left, parent_rect.top, - parent_rect.right - parent_rect.left, - parent_rect.bottom - parent_rect.top, SWP_SHOWWINDOW); - return true; - } - // First time in -- no window created by plugin yet. - GetClientRect(parent_window, &parent_rect); - set_window_style(WS_CHILD | WS_BORDER); - Init(parent_window, gfx::Rect(parent_rect)); - DCHECK(IsWindow(hwnd())); - installation_job_monitor_thread_->set_plugin_window(hwnd()); - - CreateToolTip(); - UpdateToolTip(); - - UpdateWindow(hwnd()); - ShowWindow(hwnd(), SW_SHOW); - - if (plugin_installer_state() == PluginListDownloaded) { - NotifyPluginStatus( - webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE); - } - return true; -} - -void PluginInstallerImpl::DownloadPlugin() { - set_plugin_installer_state(PluginDownloadInitiated); - - DVLOG(1) << "Initiating download for plugin URL " - << plugin_download_url_.c_str(); - - DisplayStatus(IDS_DEFAULT_PLUGIN_DOWNLOADING_PLUGIN_MSG); - - if (!plugin_download_url_for_display_) { -#if !defined(USE_AURA) - ChildThread::current()->Send(new ChromePluginProcessHostMsg_DownloadUrl( - plugin_download_url_, hwnd(), renderer_process_id())); -#endif - } else { - default_plugin::g_browser->geturl(instance(), - plugin_download_url_.c_str(), - "_blank"); - set_plugin_installer_state(PluginInstallerLaunchSuccess); - DisplayStatus(IDS_DEFAULT_PLUGIN_REFRESH_PLUGIN_MSG); - enable_click_ = true; - RefreshDisplay(); - } -} - -void PluginInstallerImpl::DownloadCancelled() { - DisplayAvailablePluginStatus(); -} - -LRESULT PluginInstallerImpl::OnEraseBackGround(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) { - HDC paint_device_context = reinterpret_cast<HDC>(wparam); - RECT erase_rect = {0}; - GetClipBox(paint_device_context, &erase_rect); - HBRUSH brush = ::CreateSolidBrush(RGB(252, 235, 162)); - DCHECK(brush); - FillRect(paint_device_context, &erase_rect, brush); - DeleteObject(brush); - return 1; -} - -// Use ICU in order to determine whether the locale is right-to-left. -// -// TODO(idana) bug# 1246452: there is already code in -// app/l10n_util.h/cc that uses ICU to determine the locale direction. We don't -// currently use this code since code in WebKit should not depend on code in -// Chrome. We can fix this by pulling (at least part of) the l10n_util -// functionality up into the Base module. -bool PluginInstallerImpl::IsRTLLayout() { - const icu::Locale& locale = icu::Locale::getDefault(); - const char* lang = locale.getLanguage(); - - // Check only for Arabic and Hebrew languages for now. - if (strcmp(lang, "ar") == 0 || strcmp(lang, "he") == 0) { - return true; - } - return false; -} - -LRESULT PluginInstallerImpl::OnPaint(UINT message, WPARAM wparam, LPARAM lparam, - BOOL& handled) { - PAINTSTRUCT paint_struct = {0}; - BeginPaint(hwnd(), &paint_struct); - - int save_dc_context = SaveDC(paint_struct.hdc); - // The drawing order is as below:- - // 1. The Get plugin link at the top left corner. - // 2. The plugin icon. - // 3. The text describing user actions to the right of the icon. - SIZE get_plugin_link_extents = {0}; - HFONT old_font = - reinterpret_cast<HFONT>(SelectObject(paint_struct.hdc, regular_font_)); - - GetTextExtentPoint32(paint_struct.hdc, get_plugin_link_message_.c_str(), - static_cast<int>(get_plugin_link_message_.length()), - &get_plugin_link_extents); - - POINT device_point = {0}; - device_point.x = get_plugin_link_extents.cx; - device_point.y = get_plugin_link_extents.cy; - LPtoDP(paint_struct.hdc, &device_point, 1); - - RECT text_rect = {0}; - text_rect.left = 5; - text_rect.right = text_rect.left + device_point.x; - text_rect.top = 5; - text_rect.bottom = text_rect.top + device_point.y; - - RECT client_rect = {0}; - GetClientRect(hwnd(), &client_rect); - - int icon_width = GetSystemMetrics(SM_CXICON); - int icon_height = GetSystemMetrics(SM_CYICON); - - int x = (client_rect.right / 2) - icon_width / 2; - int y = (client_rect.bottom / 2) - icon_height / 2; - - DCHECK(icon_); - DrawIcon(paint_struct.hdc, x, y, icon_); - - int old_mode = SetBkMode(paint_struct.hdc, TRANSPARENT); - COLORREF old_color = SetTextColor(paint_struct.hdc, RGB(0, 0, 255)); - - // If the UI layout is right-to-left, we need to mirror the position of the - // link text and also make sure that the text is aligned to the right. - DWORD draw_text_flags = DT_VCENTER; - if (IsRTLLayout()) { - draw_text_flags |= DT_RTLREADING | DT_RIGHT; - int text_width = text_rect.right - text_rect.left; - int client_width = client_rect.right - client_rect.left; - text_rect.left = client_width - text_rect.left - text_width; - text_rect.right = text_rect.left + text_width; - } else { - draw_text_flags |= DT_LEFT; - } - - DrawText(paint_struct.hdc, get_plugin_link_message_.c_str(), - static_cast<int>(get_plugin_link_message_.length()), - &text_rect, draw_text_flags); - - SIZE command_extents = {0}; - GetTextExtentPoint32(paint_struct.hdc, command_.c_str(), - static_cast<int>(command_.length()), &command_extents); - - int y_origin = y + (icon_height) + 10; - int x_origin = x - command_extents.cx / 2 + icon_width / 2; - - // If the window is too small then no point in attempting to display plugin - // information. In any case this info is displayed when the user hovers - // over the plugin window. - int window_width = client_rect.right - client_rect.left; - int window_height = client_rect.bottom - client_rect.top; - - if ((x_origin + command_extents.cx <= window_width) && - (y_origin + command_extents.cy <= window_height)) { - PaintUserActionInformation(paint_struct.hdc, x_origin, y_origin); - } - - RestoreDC(paint_struct.hdc, save_dc_context); - EndPaint(hwnd(), &paint_struct); - return 0; -} - -void PluginInstallerImpl::PaintUserActionInformation(HDC paint_dc, - int x_origin, - int y_origin) { - SelectObject(paint_dc, regular_font_); - - SIZE command_extents = {0}; - GetTextExtentPoint32(paint_dc, command_.c_str(), - static_cast<int>(command_.length()), &command_extents); - POINT device_point = {0}; - device_point.x = command_extents.cx; - device_point.y = command_extents.cy; - LPtoDP(paint_dc, &device_point, 1); - - RECT text_rect = {0}; - text_rect.left = x_origin; - text_rect.right = text_rect.left + device_point.x; - text_rect.top = y_origin; - text_rect.bottom = text_rect.top + device_point.y; - - SetTextColor(paint_dc, RGB(0, 0, 0)); - - // Make sure we pass the right BiDi flags to DrawText if the UI layout is - // right-to-left. - UINT additional_dt_flags = IsRTLLayout() ? DT_RTLREADING : 0; - DrawText(paint_dc, command_.c_str(), - static_cast<int>(command_.length()), &text_rect, - DT_CENTER | DT_VCENTER | additional_dt_flags); - - if (!optional_additional_message_.empty()) { - SelectObject(paint_dc, regular_font_); - - SIZE optional_text_extents = {0}; - int optional_message_length = - static_cast<int>(optional_additional_message_.length()); - GetTextExtentPoint32(paint_dc, - optional_additional_message_.c_str(), - optional_message_length, - &optional_text_extents); - POINT device_point = {0}; - device_point.x = optional_text_extents.cx; - device_point.y = optional_text_extents.cy; - LPtoDP(paint_dc, &device_point, 1); - - text_rect.right = text_rect.left + device_point.x; - text_rect.top = y_origin + command_extents.cy + 2; - text_rect.bottom = text_rect.top + device_point.y; - - DrawText(paint_dc, optional_additional_message_.c_str(), - static_cast<int>(optional_additional_message_.length()), - &text_rect, DT_CENTER | DT_VCENTER | additional_dt_flags); - } -} - -void PluginInstallerImpl::ShowInstallDialog() { - enable_click_ = false; - install_dialog_->ShowInstallDialog(hwnd()); -} - -LRESULT PluginInstallerImpl::OnLButtonDown(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) { - if (!enable_click_) - return 0; - if (plugin_installer_state() == PluginListDownloaded) { - ShowInstallDialog(); - NotifyPluginStatus( - webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD); - } else if (plugin_installer_state_ == PluginInstallerLaunchSuccess) { - DCHECK(default_plugin::g_browser); - DCHECK(default_plugin::g_browser->geturl); - default_plugin::g_browser->geturl( - instance_, - "javascript:navigator.plugins.refresh(true)", - "_self"); - default_plugin::g_browser->geturl( - instance_, - "javascript:window.location.reload(true)", - "_self"); - } - - return 0; -} - -LRESULT PluginInstallerImpl::OnSetCursor(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) { - if (enable_click_) { - SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); - return 1; - } - handled = FALSE; - return 0; -} - -LRESULT PluginInstallerImpl::OnRefreshPlugins(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) { - DCHECK(default_plugin::g_browser); - DCHECK(default_plugin::g_browser->geturl); - default_plugin::g_browser->geturl( - instance_, - "javascript:navigator.plugins.refresh(true)", - "_self"); - default_plugin::g_browser->geturl( - instance_, - "javascript:window.location.reload(true)", - "_self"); - return 0; -} - -LRESULT PluginInstallerImpl::OnCopyData(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) { - COPYDATASTRUCT* download_file_info = - reinterpret_cast<COPYDATASTRUCT*>(lparam); - if (!download_file_info || !download_file_info->dwData) { - DLOG(WARNING) << "Failed to download plugin"; - set_plugin_installer_state(PluginDownloadFailed); - DisplayPluginDownloadFailedStatus(); - } else { - DVLOG(1) << "Successfully downloaded plugin installer"; - set_plugin_installer_state(PluginDownloadCompleted); - - std::wstring file_path = - reinterpret_cast<const wchar_t*>(download_file_info->lpData); - - FilePath current_directory = FilePath(file_path).DirName(); - - SHELLEXECUTEINFO shell_execute_info = {0}; - shell_execute_info.cbSize = sizeof(shell_execute_info); - shell_execute_info.fMask = SEE_MASK_NOCLOSEPROCESS; - shell_execute_info.lpFile = file_path.c_str(); - shell_execute_info.lpDirectory = current_directory.value().c_str(); - shell_execute_info.nShow = SW_SHOW; - - if (!ShellExecuteEx(&shell_execute_info)) { - DLOG(WARNING) << "Failed to launch plugin installer " - << file_path.c_str() << " Error " - << ::GetLastError(); - set_plugin_installer_state(PluginInstallerLaunchFailure); - DisplayStatus(IDS_DEFAULT_PLUGIN_INSTALLATION_FAILED_MSG); - NOTREACHED(); - } else { - DVLOG(1) << "Successfully launched plugin installer"; - set_plugin_installer_state(PluginInstallerLaunchSuccess); - installation_job_monitor_thread_->AssignProcessToJob( - shell_execute_info.hProcess); - DisplayStatus(IDS_DEFAULT_PLUGIN_REFRESH_PLUGIN_MSG); - enable_click_ = true; - RefreshDisplay(); - } - } - return 0; -} - -LRESULT PluginInstallerImpl::OnInstallPluginMessage(UINT message, - WPARAM wparam, - LPARAM lparam, - BOOL& handled) { - // We could get this message because InfoBar may not be in sync with our - // internal processing. So we need to check the status. - if (plugin_installer_state() == PluginListDownloaded) { - ShowInstallDialog(); - } - return 0; -} - -bool PluginInstallerImpl::InitializeResources(HINSTANCE module_handle) { - DCHECK(icon_ == NULL); - DCHECK(regular_font_ == NULL); - DCHECK(bold_font_ == NULL); - DCHECK(underline_font_ == NULL); - - icon_ = LoadIcon(module_handle, MAKEINTRESOURCE(IDI_DEFAULT_PLUGIN_ICON)); - DCHECK(icon_ != NULL); - - desired_language_ = "en-us"; - regular_font_ = reinterpret_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT)); - DCHECK(regular_font_ != NULL); - - LOGFONT font_info = {0}; - GetObject(regular_font_, sizeof(LOGFONT), &font_info); - font_info.lfWeight |= FW_BOLD; - bold_font_ = CreateFontIndirect(&font_info); - DCHECK(bold_font_ != NULL); - - font_info.lfUnderline = TRUE; - underline_font_ = CreateFontIndirect(&font_info); - DCHECK(underline_font_ != NULL); - return true; -} - -void PluginInstallerImpl::NotifyPluginStatus(int status) { -#if !defined(USE_AURA) - if (status == webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE) { - // Show the infobar only once. - if (!IsWindow(hwnd()) || !show_install_infobar_) - return; - show_install_infobar_ = false; - } - - ChildThread::current()->Send( - new ChromePluginProcessHostMsg_MissingPluginStatus( - status, - renderer_process_id(), - render_view_id(), - hwnd())); -#endif -} diff --git a/chrome/default_plugin/plugin_impl_win.h b/chrome/default_plugin/plugin_impl_win.h deleted file mode 100644 index dc51d12..0000000 --- a/chrome/default_plugin/plugin_impl_win.h +++ /dev/null @@ -1,334 +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 CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_WIN_H_ -#define CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_WIN_H_ -#pragma once - -#include <string> - -#include "chrome/default_plugin/install_dialog.h" -#include "chrome/default_plugin/plugin_database_handler.h" -#include "chrome/default_plugin/plugin_installer_base.h" -#include "chrome/default_plugin/plugin_install_job_monitor.h" -#include "chrome/default_plugin/plugin_main.h" -#include "third_party/npapi/bindings/npapi.h" -#include "ui/base/win/window_impl.h" -#include "webkit/plugins/npapi/default_plugin_shared.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 PluginInstallerBase, - public ui::WindowImpl { - public: - static const int kRefreshPluginsMessage = WM_APP + 1; - - // 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(); - - BEGIN_MSG_MAP_EX(PluginInstallerImpl) - MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackGround) - MESSAGE_HANDLER(WM_PAINT, OnPaint) - MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown) - MESSAGE_HANDLER(kRefreshPluginsMessage, OnRefreshPlugins) - MESSAGE_HANDLER(WM_COPYDATA, OnCopyData) - MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor) - MESSAGE_HANDLER( - webkit::npapi::default_plugin::kInstallMissingPluginMessage, - OnInstallPluginMessage) - END_MSG_MAP() - - // 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(HINSTANCE module_handle, NPP instance, NPMIMEType mime_type, - int16 argc, char* argn[], char* argv[]); - - // Displays the default plugin UI. - // - // Parameters: - // window_info - // The window info passed to npapi. - bool NPP_SetWindow(NPWindow* window_info); - - // Destroys the install dialog and the plugin window. - 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. - NPP instance() const { - return instance_; - } - - // Returns whether or not the UI layout is right-to-left (such as Hebrew or - // Arabic). - static bool IsRTLLayout(); - - protected: - // Window message handlers. - LRESULT OnPaint(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); - LRESULT OnEraseBackGround(UINT message, WPARAM wparam, LPARAM lparam, - BOOL& handled); - LRESULT OnLButtonDown(UINT message, WPARAM wparam, LPARAM lparam, - BOOL& handled); - LRESULT OnSetCursor(UINT message, WPARAM wparam, LPARAM lparam, - BOOL& handled); - // Handles the install plugin message coming from the plugin infobar. - LRESULT OnInstallPluginMessage(UINT message, WPARAM wparam, LPARAM lparam, - BOOL& handled); - - // Refreshes the loaded plugin list and reloads the current page. - LRESULT OnRefreshPlugins(UINT message, WPARAM wparam, LPARAM lparam, - BOOL& handled); - - // Launches the third party plugin installer. This message is - // received when the request to download the installer, initiated by - // plugin completes. - LRESULT OnCopyData(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); - - // 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(); - - // 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(HINSTANCE module_handle); - - // 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(HDC 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 plugin instantiation mode (NP_FULL or NP_EMBED) - int16 mode_; - // The handle to the icon displayed in the plugin installation window. - HICON icon_; - // The Get plugin link message string displayed at the top left corner of - // the plugin window. - std::wstring get_plugin_link_message_; - // The command string displayed in the plugin installation window. - std::wstring command_; - // An additional message displayed at times by the plugin. - std::wstring optional_additional_message_; - // Set to true if plugin finder has been disabled. - bool disable_plugin_finder_; - // The current stream. - NPStream* plugin_install_stream_; - // The plugin finder URL. - std::string plugin_finder_url_; - // The desired mime type. - std::string mime_type_; - // The desired language. - std::string desired_language_; - // The plugin name. - std::wstring plugin_name_; - // The actual download URL. - std::string plugin_download_url_; - // Indicates if the plugin download URL points to an exe. - bool plugin_download_url_for_display_; - // The current state of the plugin installer. - PluginInstallerState plugin_installer_state_; - // Used to display the UI for plugin installation. - PluginInstallDialog* install_dialog_; - // To enable auto refresh of the plugin window once the installation - // is complete, we spawn the installation process in a job, and monitor - // IO completion events on the job. When the active process count of the - // job falls to zero, we initiate an auto refresh of the plugin list - // which enables the downloaded plugin to be instantiated. - // The completion events from the job are monitored in an independent - // thread. - scoped_refptr<PluginInstallationJobMonitorThread> - installation_job_monitor_thread_; - // This object handles download and parsing of the plugins database. - PluginDatabaseHandler plugin_database_handler_; - // Indicates if the left click to download/refresh should be enabled or not. - bool enable_click_; - // Handles to the fonts used to display text in the plugin window. - HFONT bold_font_; - HFONT regular_font_; - HFONT underline_font_; - // Tooltip Window. - HWND tooltip_; - - // Count of plugin instances. - static int instance_count_; - - // Set to true if the plugin install infobar is to be shown. - static bool show_install_infobar_; - - DISALLOW_COPY_AND_ASSIGN(PluginInstallerImpl); -}; - - -#endif // CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_WIN_H_ diff --git a/chrome/default_plugin/plugin_install_job_monitor.cc b/chrome/default_plugin/plugin_install_job_monitor.cc deleted file mode 100644 index a562569..0000000 --- a/chrome/default_plugin/plugin_install_job_monitor.cc +++ /dev/null @@ -1,111 +0,0 @@ -// 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 "chrome/default_plugin/plugin_install_job_monitor.h" - -#include "base/bind.h" -#include "base/message_loop.h" -#include "chrome/default_plugin/plugin_impl.h" - -PluginInstallationJobMonitorThread::PluginInstallationJobMonitorThread() - : Thread("Chrome plugin install thread"), - install_job_completion_port_(NULL), - stop_job_monitoring_(false), - plugin_window_(NULL), - install_job_(NULL) { -} - -PluginInstallationJobMonitorThread::~PluginInstallationJobMonitorThread() { - // The way this class is used, Thread::Stop() has always been called - // by the time we reach this point, so we do not need to call it - // again. - DCHECK(!Thread::IsRunning()); - if (install_job_) { - ::CloseHandle(install_job_); - install_job_ = NULL; - } -} - -bool PluginInstallationJobMonitorThread::Initialize() { - DCHECK(install_job_ == NULL); - - install_job_ = ::CreateJobObject(NULL, NULL); - if (install_job_ == NULL) { - DLOG(ERROR) << "Failed to create plugin install job. Error = " - << ::GetLastError(); - NOTREACHED(); - return false; - } - - return Start(); -} - -void PluginInstallationJobMonitorThread::Init() { - this->message_loop()->PostTask( - FROM_HERE, - base::Bind(&PluginInstallationJobMonitorThread::WaitForJobThread, this)); -} - -void PluginInstallationJobMonitorThread::WaitForJobThread() { - if (!install_job_) { - DLOG(WARNING) << "Invalid job information"; - NOTREACHED(); - return; - } - - DCHECK(install_job_completion_port_ == NULL); - - install_job_completion_port_ = - ::CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, - reinterpret_cast<ULONG_PTR>(install_job_), 0); - DCHECK(install_job_completion_port_ != NULL); - - JOBOBJECT_ASSOCIATE_COMPLETION_PORT job_completion_port = {0}; - job_completion_port.CompletionKey = install_job_; - job_completion_port.CompletionPort = install_job_completion_port_; - - if (!SetInformationJobObject(install_job_, - JobObjectAssociateCompletionPortInformation, - &job_completion_port, - sizeof(job_completion_port))) { - DLOG(WARNING) << "Failed to associate completion port with job object.Err " - << ::GetLastError(); - NOTREACHED(); - return; - } - - while (!stop_job_monitoring_) { - unsigned long job_event = 0; - unsigned long completion_key = 0; - LPOVERLAPPED overlapped = NULL; - - if (::GetQueuedCompletionStatus( - install_job_completion_port_, &job_event, - &completion_key, &overlapped, INFINITE)) { - if (job_event == JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO) { - DVLOG(1) << "All processes in the installer job have exited. " - "Initiating refresh on the plugins list"; - DCHECK(::IsWindow(plugin_window_)); - PostMessageW(plugin_window_, - PluginInstallerImpl::kRefreshPluginsMessage, 0, 0); - } - } - } -} - -void PluginInstallationJobMonitorThread::Stop() { - stop_job_monitoring_ = true; - ::PostQueuedCompletionStatus( - install_job_completion_port_, JOB_OBJECT_MSG_END_OF_JOB_TIME, - reinterpret_cast<ULONG_PTR>(install_job_), NULL); - Thread::Stop(); - ::CloseHandle(install_job_completion_port_); - install_job_completion_port_ = NULL; -} - -bool PluginInstallationJobMonitorThread::AssignProcessToJob( - HANDLE process_handle) { - BOOL result = AssignProcessToJobObject(install_job_, process_handle); - return result ? true : false; -} diff --git a/chrome/default_plugin/plugin_install_job_monitor.h b/chrome/default_plugin/plugin_install_job_monitor.h deleted file mode 100644 index 86233bc..0000000 --- a/chrome/default_plugin/plugin_install_job_monitor.h +++ /dev/null @@ -1,82 +0,0 @@ -// 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. - -#ifndef CHROME_DEFAULT_PLUGIN_PLUGIN_INSTALL_JOB_MONITOR_H_ -#define CHROME_DEFAULT_PLUGIN_PLUGIN_INSTALL_JOB_MONITOR_H_ -#pragma once - -#include <windows.h> - -#include "base/logging.h" -#include "base/memory/ref_counted.h" -#include "base/threading/thread.h" - -// Provides the plugin installation job monitoring functionality. -// The PluginInstallationJobMonitorThread class represents a background -// thread which monitors the install job completion port which is associated -// with the job when an instance of this class is initialized. -class PluginInstallationJobMonitorThread : - public base::Thread, - public base::RefCountedThreadSafe<PluginInstallationJobMonitorThread> { - - public: - PluginInstallationJobMonitorThread(); - - // Initializes the plugin install job. This involves creating the job object - // and starting the thread which monitors the job completion port. - // Returns true on success. - bool Initialize(); - - // Stops job monitoring and invokes the base Stop function. - void Stop(); - - // Simple setter/getters for the plugin window handle. - void set_plugin_window(HWND plugin_window) { - DCHECK(::IsWindow(plugin_window)); - plugin_window_ = plugin_window; - } - - HWND plugin_window() const { - return plugin_window_; - } - - // Adds a process to the job object. - // - // Parameters: - // process_handle - // Handle to the process which is to be added to the plugin install job. - // Returns true on success. - bool AssignProcessToJob(HANDLE process_handle); - - protected: - // Installs a task on our thread to call WaitForJobThread(). We - // can't call it directly since we would deadlock (thread which - // creates me blocks until Start() returns, and Start() doesn't - // return until Init() does). - virtual void Init(); - - // Blocks on the plugin installation job completion port by invoking the - // GetQueuedCompletionStatus API. - // We return from this function when the job monitoring thread is stopped. - virtual void WaitForJobThread(); - - private: - friend class base::RefCountedThreadSafe<PluginInstallationJobMonitorThread>; - - virtual ~PluginInstallationJobMonitorThread(); - - // The install job completion port. Created in Init. - HANDLE install_job_completion_port_; - // Indicates that job monitoring is to be stopped - bool stop_job_monitoring_; - // The install job. Should be created before the job monitor thread - // is started. - HANDLE install_job_; - // The plugin window handle. - HWND plugin_window_; - - DISALLOW_COPY_AND_ASSIGN(PluginInstallationJobMonitorThread); -}; - -#endif // CHROME_DEFAULT_PLUGIN_PLUGIN_INSTALL_JOB_MONITOR_H_ diff --git a/chrome/default_plugin/plugin_installer_base.cc b/chrome/default_plugin/plugin_installer_base.cc deleted file mode 100644 index 8326bcb..0000000 --- a/chrome/default_plugin/plugin_installer_base.cc +++ /dev/null @@ -1,33 +0,0 @@ -// 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 "chrome/default_plugin/plugin_installer_base.h" - -#include "base/string_number_conversions.h" -#include "base/string_util.h" -#include "content/public/common/content_constants.h" - -PluginInstallerBase::PluginInstallerBase() - : renderer_process_id_(0), - render_view_id_(0) { -} - -PluginInstallerBase::~PluginInstallerBase() { -} - -void PluginInstallerBase::SetRoutingIds(int16 argc, - char* argn[], - char* argv[]) { - for (int16_t index = 0; index < argc; ++index) { - if (!base::strncasecmp(argn[index], - content::kDefaultPluginRenderProcessId, - strlen(argn[index]))) { - base::StringToInt(argv[index], &renderer_process_id_); - } else if (!base::strncasecmp(argn[index], - content::kDefaultPluginRenderViewId, - strlen(argn[index]))) { - base::StringToInt(argv[index], &render_view_id_); - } - } -} diff --git a/chrome/default_plugin/plugin_installer_base.h b/chrome/default_plugin/plugin_installer_base.h deleted file mode 100644 index 1f20a68..0000000 --- a/chrome/default_plugin/plugin_installer_base.h +++ /dev/null @@ -1,34 +0,0 @@ -// 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. - -#ifndef CHROME_DEFAULT_PLUGIN_PLUGIN_INSTALLER_BASE_H_ -#define CHROME_DEFAULT_PLUGIN_PLUGIN_INSTALLER_BASE_H_ - -#include "base/basictypes.h" -#include "third_party/npapi/bindings/npapi.h" - -// Base class for the plugin installer. -class PluginInstallerBase { - public: - PluginInstallerBase(); - virtual ~PluginInstallerBase(); - - // Parses the arguments passed in to the plug-in for the IDs of the renderer - // process and RenderView. - void SetRoutingIds(int16 argc, char* argn[], char* argv[]); - - int renderer_process_id() const { - return renderer_process_id_; - } - - int render_view_id() const { - return render_view_id_; - } - - private: - int renderer_process_id_; - int render_view_id_; -}; - -#endif // CHROME_DEFAULT_PLUGIN_PLUGIN_INSTALLER_BASE_H_ diff --git a/chrome/default_plugin/plugin_main.cc b/chrome/default_plugin/plugin_main.cc deleted file mode 100644 index f7b15ab..0000000 --- a/chrome/default_plugin/plugin_main.cc +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (c) 2006-2008 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 "chrome/default_plugin/plugin_main.h" - -#include "base/logging.h" -#include "base/string_util.h" -#include "chrome/default_plugin/plugin_impl.h" -#include "webkit/glue/webkit_glue.h" - -namespace default_plugin { - -#if defined(OS_WIN) -// -// Forward declare the linker-provided pseudo variable for the -// current module handle. -// -extern "C" IMAGE_DOS_HEADER __ImageBase; - -// get the handle to the currently executing module -inline HMODULE GetCurrentModuleHandle() { - return reinterpret_cast<HINSTANCE>(&__ImageBase); -} -#endif - -// Initialized in NP_Initialize. -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->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->getvalue = NULL; -#endif - funcs->setvalue = NULL; - return NPERR_NO_ERROR; -} - -NPError API_CALL NP_Initialize(NPNetscapeFuncs* funcs) { - g_browser = 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; -} - -namespace { -// This function is only invoked when the default plugin is invoked -// with a special mime type application/chromium-test-default-plugin -void SignalTestResult(NPP instance) { - NPObject *window_obj = NULL; - g_browser->getvalue(instance, NPNVWindowNPObject, &window_obj); - if (!window_obj) { - NOTREACHED(); - return; - } - - std::string script = "javascript:onSuccess()"; - NPString script_string; - script_string.UTF8Characters = script.c_str(); - script_string.UTF8Length = - static_cast<unsigned int>(script.length()); - - NPVariant result_var; - g_browser->evaluate(instance, window_obj, - &script_string, &result_var); - g_browser->releaseobject(window_obj); -} - -} // namespace CHROMIUM_DefaultPluginTest - -bool NegotiateModels(NPP instance) { -#if defined(OS_MACOSX) - NPError err; - // Set drawing model to core graphics - NPBool supportsCoreGraphics = false; - err = g_browser->getvalue(instance, - NPNVsupportsCoreGraphicsBool, - &supportsCoreGraphics); - if (err != NPERR_NO_ERROR || !supportsCoreGraphics) { - NOTREACHED(); - return false; - } - err = g_browser->setvalue(instance, - NPPVpluginDrawingModel, - (void*)NPDrawingModelCoreGraphics); - if (err != NPERR_NO_ERROR) { - NOTREACHED(); - return false; - } - - // Set event model to cocoa - NPBool supportsCocoaEvents = false; - err = g_browser->getvalue(instance, - NPNVsupportsCocoaBool, - &supportsCocoaEvents); - if (err != NPERR_NO_ERROR || !supportsCocoaEvents) { - NOTREACHED(); - return false; - } - err = g_browser->setvalue(instance, - NPPVpluginEventModel, - (void*)NPEventModelCocoa); - if (err != NPERR_NO_ERROR) { - 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; -} - -NPError NPP_New(NPMIMEType plugin_type, NPP instance, uint16_t mode, - int16_t argc, char* argn[], char* argv[], NPSavedData* saved) { - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - if (!NegotiateModels(instance)) - return NPERR_INCOMPATIBLE_VERSION_ERROR; - - PluginInstallerImpl* plugin_impl = new PluginInstallerImpl(mode); - plugin_impl->Initialize( -#if defined(OS_WIN) - GetCurrentModuleHandle(), -#else - NULL, -#endif - instance, plugin_type, argc, - argn, argv); - - instance->pdata = reinterpret_cast<void*>(plugin_impl); - - if (!base::strcasecmp(plugin_type, - "application/chromium-test-default-plugin")) { - SignalTestResult(instance); - } - - return NPERR_NO_ERROR; -} - -NPError NPP_Destroy(NPP instance, NPSavedData** save) { - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - if (plugin_impl) { - plugin_impl->Shutdown(); - delete plugin_impl; - } - - return NPERR_NO_ERROR; -} - -NPError NPP_SetWindow(NPP instance, NPWindow* window_info) { - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - if (window_info == NULL) { - NOTREACHED(); - return NPERR_GENERIC_ERROR; - } - - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - if (plugin_impl == NULL) { - NOTREACHED(); - return NPERR_GENERIC_ERROR; - } - - if (!plugin_impl->NPP_SetWindow(window_info)) { - delete plugin_impl; - return NPERR_GENERIC_ERROR; - } - - return NPERR_NO_ERROR; -} - -NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, - NPBool seekable, uint16_t* stype) { - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - if (!plugin_impl) { - NOTREACHED(); - return NPERR_INVALID_INSTANCE_ERROR; - } - - plugin_impl->NewStream(stream); - return NPERR_NO_ERROR; -} - -NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason) { - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - if (!plugin_impl) { - NOTREACHED(); - return NPERR_INVALID_INSTANCE_ERROR; - } - - plugin_impl->DestroyStream(stream, reason); - return NPERR_NO_ERROR; -} - -int32_t NPP_WriteReady(NPP instance, NPStream* stream) { - if (instance == NULL) - return 0; - - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - if (!plugin_impl) { - NOTREACHED(); - return 0; - } - - if (plugin_impl->WriteReady(stream)) - return 0x7FFFFFFF; - return 0; -} - -int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, - void* buffer) { - if (instance == NULL) - return 0; - - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - if (!plugin_impl) { - NOTREACHED(); - return 0; - } - - return plugin_impl->Write(stream, offset, len, buffer); -} - -void NPP_URLNotify(NPP instance, const char* url, NPReason reason, - void* notifyData) { - if (instance != NULL) { - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - if (!plugin_impl) { - NOTREACHED(); - return; - } - - plugin_impl->URLNotify(url, 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_t NPP_HandleEvent(NPP instance, void* event) { - if (instance == NULL) - return 0; - - PluginInstallerImpl* plugin_impl = - reinterpret_cast<PluginInstallerImpl*>(instance->pdata); - - return plugin_impl->NPP_HandleEvent(event); -} - -} // default_plugin diff --git a/chrome/default_plugin/plugin_main.h b/chrome/default_plugin/plugin_main.h deleted file mode 100644 index ba252bd..0000000 --- a/chrome/default_plugin/plugin_main.h +++ /dev/null @@ -1,40 +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 <algorithm> - -#include "third_party/npapi/bindings/npapi.h" -#include "third_party/npapi/bindings/nphostapi.h" - -namespace default_plugin { - -extern NPNetscapeFuncs* g_browser; - -// Standard NPAPI functions. -NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, - int16_t argc, char* argn[], char* argv[], NPSavedData* saved); -NPError NPP_Destroy(NPP instance, NPSavedData** save); -NPError NPP_SetWindow(NPP instance, NPWindow* window); -NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, - NPBool seekable, uint16_t* stype); -NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason); -int32_t NPP_WriteReady(NPP instance, NPStream* stream); -int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t 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_t 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 diff --git a/chrome/default_plugin/plugins.xml b/chrome/default_plugin/plugins.xml deleted file mode 100644 index 8799ca9..0000000 --- a/chrome/default_plugin/plugins.xml +++ /dev/null @@ -1,653 +0,0 @@ -<plugins> - <plugin> - <mime>application/x-java-applet</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-vm</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.1.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.1.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.1.3</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.1.3</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.1.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.1.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.3</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.3</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.2.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.2.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.2.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.2.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.3.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.3.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.4</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.4</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.4.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.4.1</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.4.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.4.2</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.5</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.5</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-applet,version=1.6</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>application/x-java-bean,version=1.6</mime> - <lang>en-us</lang> - <name>Java(TM) Platform SE6 U10 (Beta)</name> - <url>http://javadl.sun.com/webapps/download/GetFile/1.6.0_10-b33/windows-i586/jre-6u10-windows-i586-p-iftw.exe</url> - </plugin> - - <plugin> - <mime>audio/x-pn-realaudio-plugin</mime> - <lang>en-us</lang> - <name>Real player</name> - <url>http://software-dl.real.com/free/windows/installer/R41R02F/RealPlayer11GOLD.exe</url> - </plugin> - - <plugin> - <mime>audio/x-pn-realaudio</mime> - <lang>en-us</lang> - <name>Real player</name> - <url>http://software-dl.real.com/free/windows/installer/R41R02F/RealPlayer11GOLD.exe</url> - </plugin> - - <plugin> - <mime>audio/vnd.rn-realaudio</mime> - <lang>en-us</lang> - <name>Real player</name> - <url>http://software-dl.real.com/free/windows/installer/R41R02F/RealPlayer11GOLD.exe</url> - </plugin> - - <plugin> - <mime>video/vnd.rn-realvideo</mime> - <lang>en-us</lang> - <name>Real player</name> - <url>http://software-dl.real.com/free/windows/installer/R41R02F/RealPlayer11GOLD.exe</url> - </plugin> - - <plugin> - <mime>application/x-shockwave-flash</mime> - <lang>en-us</lang> - <name>Adobe Flash Movie</name> - <url>http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player.exe</url> - </plugin> - - <plugin> - <mime>application/futuresplash</mime> - <lang>en-us</lang> - <name>Adobe FutureSpash Movie</name> - <url>http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player.exe</url> - </plugin> - - <plugin> - <mime>application/x-director</mime> - <lang>en-us</lang> - <name>Adobe Shockwave Movie</name> - <url>http://fpdownload.macromedia.com/get/shockwave/default/english/win95nt/10.2.0.023/Shockwave_Installer_Slim.exe</url> - </plugin> - - <plugin> - <mime>application/pdf</mime> - <lang>en-us</lang> - <name>Adobe Acrobat</name> - <url>http://ardownload.adobe.com/pub/adobe/reader/win/8.x/8.1.2/enu/AdbeRdr812_en_US.exe</url> - </plugin> - - <plugin> - <mime>application/vnd.adobe.x-mars</mime> - <lang>en-us</lang> - <name>Adobe Acrobat</name> - <url>http://ardownload.adobe.com/pub/adobe/reader/win/8.x/8.1.2/enu/AdbeRdr812_en_US.exe</url> - </plugin> - - <plugin> - <mime>application/vnd.fdf</mime> - <lang>en-us</lang> - <name>Adobe Acrobat</name> - <url>http://ardownload.adobe.com/pub/adobe/reader/win/8.x/8.1.2/enu/AdbeRdr812_en_US.exe</url> - </plugin> - - <plugin> - <mime>application/vnd.adobe.xfdf</mime> - <lang>en-us</lang> - <name>Adobe Acrobat</name> - <url>http://ardownload.adobe.com/pub/adobe/reader/win/8.x/8.1.2/enu/AdbeRdr812_en_US.exe</url> - </plugin> - - <plugin> - <mime>application/vnd.adobe.xdp+xml</mime> - <lang>en-us</lang> - <name>Adobe Acrobat</name> - <url>http://ardownload.adobe.com/pub/adobe/reader/win/8.x/8.1.2/enu/AdbeRdr812_en_US.exe</url> - </plugin> - - <plugin> - <mime>application/vnd.adobe.xfd+xml</mime> - <lang>en-us</lang> - <name>Adobe Acrobat</name> - <url>http://ardownload.adobe.com/pub/adobe/reader/win/8.x/8.1.2/enu/AdbeRdr812_en_US.exe</url> - </plugin> - - <plugin> - <mime>video/quicktime</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>application/sdp</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>application/x-sdp</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>application/x-rtsp</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/flc</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-wav</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/wav</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/aiff</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-aiff</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/basic</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/mid</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-midi</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/midi</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/vnd.qcelp</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-gsm</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/amr</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/aac</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-aac</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-caf</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/ac3</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-ac3</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/x-mpeg</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/mpeg</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/mpeg</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-mpeg</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/3ggp</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/3ggp</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/3ggp2</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/3ggp2</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/sd-video</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>application/x-mpeg</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/mp4</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/mp4</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-m4a</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-m4p</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>audio/x-m4b</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>video/x-m4v</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/x-macpaint</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/pict</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/x-pict</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/png</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/x-png</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/x-quicktime</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/x-sgi</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/x-targa</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/jp2</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/jpeg2000</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/jpeg2000-image</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime>image/x-jpeg2000-image</mime> - <lang>en-us</lang> - <name>Quicktime player</name> - <url>http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=19502&cat=59&platform=osx&method=sa/QuickTimeInstaller.exe</url> - </plugin> - -</plugins>
\ No newline at end of file diff --git a/chrome/default_plugin/plugins2.xml b/chrome/default_plugin/plugins2.xml deleted file mode 100644 index cd0c74d..0000000 --- a/chrome/default_plugin/plugins2.xml +++ /dev/null @@ -1,59 +0,0 @@ -<plugins> - <plugin> - <mime_types>application/x-java-applet;application/x-java-bean;application/x-java-vm;application/x-java-applet,version=1.1.1;application/x-java-bean,version=1.1.1;application/x-java-applet,version=1.1;application/x-java-bean,version=1.1;application/x-java-applet,version=1.2;application/x-java-bean,version=1.2;application/x-java-applet,version=1.1.3;application/x-java-bean,version=1.1.3;application/x-java-applet,version=1.1.2;application/x-java-bean,version=1.1.2;application/x-java-applet,version=1.3;application/x-java-bean,version=1.3;application/x-java-applet,version=1.2.2;application/x-java-bean,version=1.2.2;application/x-java-applet,version=1.2.1;application/x-java-bean,version=1.2.1;application/x-java-applet,version=1.3.1;application/x-java-bean,version=1.3.1;application/x-java-applet,version=1.4;application/x-java-bean,version=1.4;application/x-java-applet,version=1.4.1;application/x-java-bean,version=1.4.1;application/x-java-applet,version=1.4.2;application/x-java-bean,version=1.4.2;application/x-java-applet,version=1.5;application/x-java-bean,version=1.5;application/x-java-applet,version=1.6;application/x-java-bean,version=1.6;</mime_types> - <lang>en-us</lang> - <name>Java(TM)</name> - <url>http://java.com/download</url> - <displayurl>1</displayurl> - </plugin> - - <plugin> - <mime_types>audio/x-pn-realaudio-plugin;audio/x-pn-realaudio;audio/vnd.rn-realaudio;video/vnd.rn-realvideo</mime_types> - <lang>en-us</lang> - <name>RealPlayer</name> - <url>http://forms.real.com/real/realone/download.html?type=rpsp_us</url> - </plugin> - - <plugin> - <mime_types>application/x-shockwave-flash;application/futuresplash</mime_types> - <lang>en-us</lang> - <name>Adobe Flash Player</name> - <url>http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player.exe</url> - </plugin> - - <plugin> - <mime_types>application/x-director</mime_types> - <lang>en-us</lang> - <name>Adobe Shockwave Player</name> - <url>http://fpdownload.macromedia.com/get/shockwave/default/english/win95nt/latest/Shockwave_Installer_Slim.exe</url> - </plugin> - - <plugin> - <mime_types>application/pdf;application/vnd.adobe.x-mars;application/vnd.fdf;application/vnd.adobe.xfdf;application/vnd.adobe.xdp+xml;application/vnd.adobe.xfd+xml;</mime_types> - <lang>en-us</lang> - <name>Adobe Reader</name> - <url>http://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.1/enu/AdbeRdr910_en_US.exe</url> - </plugin> - - <plugin> - <mime_types>video/quicktime;application/sdp;application/x-sdp;application/x-rtsp;video/flc;audio/x-wav;audio/wav;audio/aiff;audio/x-aiff;audio/basic;audio/mid;audio/x-midi;audio/midi;audio/vnd.qcelp;audio/x-gsm;audio/amr;audio/aac;audio/x-aac;audio/x-caf;audio/ac3;audio/x-ac3;video/x-mpeg;video/mpeg;audio/mpeg;audio/x-mpeg;video/3ggp;audio/3ggp;video/3ggp2;audio/3ggp2;video/sd-video;application/x-mpeg;video/mp4;audio/mp4;audio/x-m4a;audio/x-m4p;audio/x-m4b;video/x-m4v;image/x-macpaint;image/pict;image/x-pict;image/png;image/x-png;image/x-quicktime;image/x-sgi;image/x-targa;image/jp2;image/jpeg2000;image/jpeg2000-image;image/x-jpeg2000-image</mime_types> - <lang>en-us</lang> - <name>QuickTime Player</name> - <url>http://appldnld.apple.com.edgesuite.net/content.info.apple.com/QuickTime/061-6118.20090601.Pq3V9/QuickTimeInstaller.exe</url> - </plugin> - - <plugin> - <mime_types>application/x-ms-wmp;application/asx;video/x-ms-asf-plugin;application/x-mplayer2;video/x-ms-asf;video/x-ms-wm;audio/x-ms-wma;audio/x-ms-wax;video/x-ms-wmv;video/x-ms-wvx</mime_types> - <lang>en-us</lang> - <name>Windows Media Player Plugin</name> - <url>http://port25.technet.com/videos/downloads/wmpfirefoxplugin.exe</url> - </plugin> - - <plugin> - <mime_types>video/divx;video/x-matroska</mime_types> - <lang>en-us</lang> - <name>DivX Web Player</name> - <url>http://download.divx.com/player/divxdotcom/DivXWebPlayerInstaller.exe</url> - </plugin> - -</plugins>
\ No newline at end of file diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index e76a03d..caa5382 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -334,10 +334,6 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( orig_mime_type, url); return MissingPlugin::Create(render_view, frame, original_params); } - if (plugin.path.value() == webkit::npapi::kDefaultPluginLibraryName) { - MissingPluginReporter::GetInstance()->ReportPluginMissing( - orig_mime_type, url); - } scoped_ptr<webkit::npapi::PluginGroup> group( webkit::npapi::PluginList::Singleton()->GetPluginGroup(plugin)); @@ -399,8 +395,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( bool is_nacl_plugin = (plugin.name == ASCIIToUTF16( chrome::ChromeContentClient::kNaClPluginName)); if (status.value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed || - observer->plugins_temporarily_allowed() || - plugin.path.value() == webkit::npapi::kDefaultPluginLibraryName) { + observer->plugins_temporarily_allowed()) { // Delay loading plugins if prerendering. if (prerender::PrerenderHelper::IsPrerendering(render_view)) { return BlockedPlugin::Create( diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp index a1c3c6e..95ce7c5 100644 --- a/chrome_frame/chrome_frame.gyp +++ b/chrome_frame/chrome_frame.gyp @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 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. @@ -154,7 +154,8 @@ ['OS=="win"', { 'link_settings': { 'libraries': [ - '-lshdocvw.lib', '-loleacc.lib', + '-lshdocvw.lib', + '-loleacc.lib', ], }, 'msvs_settings': { @@ -765,6 +766,9 @@ # Crash Reporting 'crash_reporting/crash_reporting.gyp:crash_report', ], + 'link_settings': { + 'libraries': ['-lurlmon.lib'], + }, },], ], 'rules': [ diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index 6718d6e..87614a2 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -41,10 +41,6 @@ void MockContentBrowserClient::RenderProcessHostCreated( RenderProcessHost* host) { } -void MockContentBrowserClient::PluginProcessHostCreated( - PluginProcessHost* host) { -} - WebUIFactory* MockContentBrowserClient::GetWebUIFactory() { // Return an empty factory so callsites don't have to check for NULL. return EmptyWebUIFactory::GetInstance(); diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index 128cf71..b441703 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -29,7 +29,6 @@ class MockContentBrowserClient : public ContentBrowserClient { RenderViewHost* render_view_host) OVERRIDE; virtual void RenderProcessHostCreated( RenderProcessHost* host) OVERRIDE; - virtual void PluginProcessHostCreated(PluginProcessHost* host) OVERRIDE; virtual WebUIFactory* GetWebUIFactory() OVERRIDE; virtual GURL GetEffectiveURL(content::BrowserContext* browser_context, const GURL& url) OVERRIDE; diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index a515b58..ad8d074 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -280,8 +280,6 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { // been destroyed. process_->SetTerminateChildOnShutdown(false); - content::GetContentClient()->browser()->PluginProcessHostCreated(this); - return true; } diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index cdb4db9..fad5d5e 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -451,13 +451,6 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, url, mime_type, allow_wildcard, &plugins, &mime_types); if (is_stale) *is_stale = stale; - if (plugins.size() > 1 && - plugins.back().path == - FilePath(webkit::npapi::kDefaultPluginLibraryName)) { - // If there is at least one plug-in handling the required MIME type (apart - // from the default plug-in), we don't need the default plug-in. - plugins.pop_back(); - } for (size_t i = 0; i < plugins.size(); ++i) { if (!filter_ || filter_->ShouldUsePlugin(render_process_id, diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc index e685416..f5a4998 100644 --- a/content/plugin/webplugin_delegate_stub.cc +++ b/content/plugin/webplugin_delegate_stub.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -181,16 +181,6 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, std::vector<std::string> arg_names = params.arg_names; std::vector<std::string> arg_values = params.arg_values; - if (path.value() == webkit::npapi::kDefaultPluginLibraryName) { - // Add the renderer process id and Render view routing id to the list of - // parameters passed to the plugin. - arg_names.push_back(content::kDefaultPluginRenderViewId); - arg_values.push_back(base::IntToString( - params.host_render_view_routing_id)); - - arg_names.push_back(content::kDefaultPluginRenderProcessId); - arg_values.push_back(base::IntToString(channel_->renderer_id())); - } *result = delegate_->Initialize(params.url, arg_names, arg_values, diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 9151f87..c83631b 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -96,11 +96,6 @@ class ContentBrowserClient { virtual void RenderProcessHostCreated( content::RenderProcessHost* host) = 0; - // Notifies that a PluginProcessHost has been created. This is called - // before the content layer adds its own message filters, so that the - // embedder's IPC filters have priority. - virtual void PluginProcessHostCreated(PluginProcessHost* host) = 0; - // Gets the WebUIFactory which will be responsible for generating WebUIs. virtual WebUIFactory* GetWebUIFactory() = 0; diff --git a/content/public/common/content_constants.cc b/content/public/common/content_constants.cc index 949744a..4b0a5bf 100644 --- a/content/public/common/content_constants.cc +++ b/content/public/common/content_constants.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -13,9 +13,6 @@ const size_t kMaxTitleChars = 4 * 1024; const size_t kMaxURLChars = 2 * 1024 * 1024; const size_t kMaxURLDisplayChars = 32 * 1024; -const char kDefaultPluginRenderViewId[] = "PluginRenderViewId"; -const char kDefaultPluginRenderProcessId[] = "PluginRenderProcessId"; - #if defined(GOOGLE_CHROME_BUILD) const wchar_t kBrowserAppName[] = L"Chrome"; const char kStatsFilename[] = "ChromeStats2"; diff --git a/content/public/common/content_constants.h b/content/public/common/content_constants.h index 59ec3f4..453c541 100644 --- a/content/public/common/content_constants.h +++ b/content/public/common/content_constants.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -32,11 +32,6 @@ extern const size_t kMaxTitleChars; CONTENT_EXPORT extern const size_t kMaxURLChars; CONTENT_EXPORT extern const size_t kMaxURLDisplayChars; -// The render view and render process id associated with the default plugin -// instance. -CONTENT_EXPORT extern const char kDefaultPluginRenderViewId[]; -CONTENT_EXPORT extern const char kDefaultPluginRenderProcessId[]; - extern const char kStatsFilename[]; extern const int kStatsMaxThreads; extern const int kStatsMaxCounters; diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc index 2e7d33e..79d9be7 100644 --- a/content/shell/shell_content_browser_client.cc +++ b/content/shell/shell_content_browser_client.cc @@ -53,10 +53,6 @@ void ShellContentBrowserClient::RenderProcessHostCreated( RenderProcessHost* host) { } -void ShellContentBrowserClient::PluginProcessHostCreated( - PluginProcessHost* host) { -} - WebUIFactory* ShellContentBrowserClient::GetWebUIFactory() { // Return an empty factory so callsites don't have to check for NULL. return EmptyWebUIFactory::GetInstance(); diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h index 4bf8c1b..f9238cc 100644 --- a/content/shell/shell_content_browser_client.h +++ b/content/shell/shell_content_browser_client.h @@ -33,7 +33,6 @@ class ShellContentBrowserClient : public ContentBrowserClient { RenderViewHost* render_view_host) OVERRIDE; virtual void RenderProcessHostCreated( RenderProcessHost* host) OVERRIDE; - virtual void PluginProcessHostCreated(PluginProcessHost* host) OVERRIDE; virtual WebUIFactory* GetWebUIFactory() OVERRIDE; virtual GURL GetEffectiveURL(content::BrowserContext* browser_context, const GURL& url) OVERRIDE; diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids index fe4e3e5..733038f 100644 --- a/tools/gritsettings/resource_ids +++ b/tools/gritsettings/resource_ids @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 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. # @@ -31,9 +31,6 @@ "chrome/common/common_resources.grd": { "includes": [2500], }, - "chrome/default_plugin/default_plugin_resources.grd": { - "includes": [3000], - }, "chrome/renderer/renderer_resources.grd": { "includes": [3500], }, diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index de1b6c6..2f4bd5a 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -164,7 +164,6 @@ '../plugins/npapi/carbon_plugin_window_tracker_mac.cc', '../plugins/npapi/carbon_plugin_window_tracker_mac.h', '../plugins/npapi/coregraphics_private_symbols_mac.h', - '../plugins/npapi/default_plugin_shared.h', '../plugins/npapi/gtk_plugin_container.cc', '../plugins/npapi/gtk_plugin_container.h', '../plugins/npapi/gtk_plugin_container_manager.cc', diff --git a/webkit/glue/webkit_strings.grd b/webkit/glue/webkit_strings.grd index 3cdb9ca..079afaf 100644 --- a/webkit/glue/webkit_strings.grd +++ b/webkit/glue/webkit_strings.grd @@ -389,72 +389,6 @@ below: Please shorten this text to <ph name="MAX_CHARACTERS">$2<ex>100</ex></ph> characters or less (you are currently using <ph name="CURRENT_LENGTH">$1<ex>101</ex></ph> characters). </message> - <message name="IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG" desc="Message displayed by the default plugin in its main window"> - <ph name="PLUGIN">$1<ex>Realplayer</ex></ph> plug-in is not installed. - </message> - - <message name="IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_NO_PLUGIN_NAME" desc="Message displayed by the default plugin in its main window when we don't know the plugin name"> - The required plug-in is not installed. - </message> - - <message name="IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_PLUGIN_FINDER_DISABLED" desc="Message displayed by the default plugin in its main window when the plugin finder has been disabled by a policy."> - Installing plug-ins has been disabled. - </message> - - <message name="IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_2" desc="Second Message displayed by the default plugin in its main window"> - Click here to download plug-in - </message> - - <message name="IDS_DEFAULT_PLUGIN_REFRESH_PLUGIN_MSG" desc="Message displayed by the default plugin to refresh the window after installing the required plugin"> - After installing the plug-in, click here to refresh - </message> - - <message name="IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG" desc="Message displayed by the default plugin when no plugin was found for the page."> - No plug-in available to display this content. - </message> - - <message name="IDS_DEFAULT_PLUGIN_DOWNLOADING_PLUGIN_MSG" desc="Message displayed by the default plugin when a download has been initiated for the third party plugin."> - Downloading plug-in... - </message> - - <message name="IDS_DEFAULT_PLUGIN_GET_THE_PLUGIN_BTN_MSG" desc="Message displayed by the default plugin on the button which the user should click to fetch the plugin."> - Get Plug-in - </message> - - <message name="IDS_DEFAULT_PLUGIN_CANCEL_PLUGIN_DOWNLOAD_MSG" desc="Message displayed by the default plugin on the button which the user should click to cancel the plugin download."> - Cancel - </message> - - <message name="IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE" desc="Default plugin confirmation dialog title."> - <ph name="PLUGIN">$1<ex>Realplayer</ex></ph> plug-in needed - </message> - - <message name="IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE_NO_PLUGIN_NAME" desc="Default plugin confirmation dialog title when we don't know the plugin name"> - Additional plug-in needed - </message> - - <message name="IDS_DEFAULT_PLUGIN_USER_OPTION_MSG" desc="Message displayed by the default plugin in the install dialog indicating information on the user action."> - Please confirm that you would like to install the <ph name="PLUGIN">$1<ex>realplayer</ex></ph> plug-in. You should only install plug-ins that you trust. - </message> - <message name="IDS_DEFAULT_PLUGIN_USER_OPTION_MSG_NO_PLUGIN_NAME" desc="Message displayed by the default plugin in the install dialog indicating information on the user action when we don't know the plugin name"> - Please confirm that you would like to install this plug-in. You should only install plug-ins that you trust. - </message> - - <message name="IDS_DEFAULT_PLUGIN_USE_OPTION_CONFIRM" desc="Button to confirm installation of plugin"> - Install - </message> - <message name="IDS_DEFAULT_PLUGIN_USE_OPTION_CANCEL" desc="Button to cancel installation of plugin"> - Cancel - </message> - - <message name="IDS_DEFAULT_PLUGIN_DOWNLOAD_FAILED_MSG" desc="Message displayed by the default plugin when download is failed."> - Failed to install plug-in from <ph name="URL">$1<ex>http://www.google.com/blablah.exe</ex></ph> - </message> - - <message name="IDS_DEFAULT_PLUGIN_INSTALLATION_FAILED_MSG" desc="Message displayed by the default plugin when installation is failed."> - Plug-in installation failed - </message> - <message name="IDS_PDF_NEED_PASSWORD" desc="A message asking the user for a password to open a PDF file."> This document is password protected. Please enter a password. </message> diff --git a/webkit/plugins/npapi/default_plugin_shared.h b/webkit/plugins/npapi/default_plugin_shared.h deleted file mode 100644 index e1ab659..0000000 --- a/webkit/plugins/npapi/default_plugin_shared.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2006-2008 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. -// -// Thes file contains stuff that should be shared among projects that do some -// special handling with default plugin - -#ifndef WEBKIT_PLUGINS_NPAPI_DEFAULT_PLUGIN_SHARED_H -#define WEBKIT_PLUGINS_NPAPI_DEFAULT_PLUGIN_SHARED_H - -namespace webkit { -namespace npapi { - -namespace default_plugin { - -// We use the NPNGetValue host function to send notification message to host. -// This corresponds to NPNVariable defined in npapi.h, and should be chosen so -// as to not overlap values if NPAPI is updated. - -const int kMissingPluginStatusStart = 5000; - -enum MissingPluginStatus { - MISSING_PLUGIN_AVAILABLE, - MISSING_PLUGIN_USER_STARTED_DOWNLOAD -}; - -#if defined(OS_WIN) -#include <windows.h> -const int kInstallMissingPluginMessage = WM_APP + 117; -#endif - -} // namespace default_plugin - -} // namespace npapi -} // namespace webkit - -#endif // WEBKIT_PLUGINS_NPAPI_DEFAULT_PLUGIN_SHARED_H diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc index dbd4052..25df1f8 100644 --- a/webkit/plugins/npapi/plugin_host.cc +++ b/webkit/plugins/npapi/plugin_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -21,7 +21,6 @@ #include "ui/gfx/gl/gl_implementation.h" #include "ui/gfx/gl/gl_surface.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/plugins/npapi/default_plugin_shared.h" #include "webkit/plugins/npapi/plugin_instance.h" #include "webkit/plugins/npapi/plugin_lib.h" #include "webkit/plugins/npapi/plugin_list.h" diff --git a/webkit/plugins/npapi/plugin_list.cc b/webkit/plugins/npapi/plugin_list.cc index 0f9e4cf..f13e1ea 100644 --- a/webkit/plugins/npapi/plugin_list.cc +++ b/webkit/plugins/npapi/plugin_list.cc @@ -53,9 +53,6 @@ bool AllowMimeTypeMismatch(const std::string& orig_mime_type, namespace webkit { namespace npapi { -FilePath::CharType kDefaultPluginLibraryName[] = - FILE_PATH_LITERAL("default_plugin"); - // Some version ranges can be shared across operating systems. This should be // done where possible to avoid duplication. // This is up to date with @@ -268,9 +265,6 @@ void PluginList::RegisterInternalPluginWithEntryPoints( } else { extra_plugin_paths_.push_back(info.path); } - - if (info.path.value() == kDefaultPluginLibraryName) - default_plugin_enabled_ = true; } void PluginList::UnregisterInternalPlugin(const FilePath& path) { @@ -360,8 +354,7 @@ bool PluginList::ParseMimeTypes( } PluginList::PluginList() - : plugins_need_refresh_(true), - default_plugin_enabled_(false) { + : plugins_need_refresh_(true) { PlatformInit(); AddHardcodedPluginGroups(kGroupDefinitions, ARRAYSIZE_UNSAFE(kGroupDefinitions)); @@ -369,8 +362,7 @@ PluginList::PluginList() PluginList::PluginList(const PluginGroupDefinition* definitions, size_t num_definitions) - : plugins_need_refresh_(true), - default_plugin_enabled_(false) { + : plugins_need_refresh_(true) { // Don't do platform-dependend initialization in unit tests. AddHardcodedPluginGroups(definitions, num_definitions); } @@ -436,11 +428,10 @@ void PluginList::LoadPlugin(const FilePath& path, if (!ShouldLoadPlugin(plugin_info, plugin_groups)) return; - if (path.value() != kDefaultPluginLibraryName #if defined(OS_WIN) && !defined(NDEBUG) - && path.BaseName().value() != L"npspy.dll" // Make an exception for NPSPY + if (path.BaseName().value() != L"npspy.dll") // Make an exception for NPSPY #endif - ) { + { for (size_t i = 0; i < plugin_info.mime_types.size(); ++i) { // TODO: don't load global handlers for now. // WebKit hands to the Plugin before it tries @@ -475,8 +466,6 @@ void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) { plugin_paths->end()) { continue; } - if (path.value() == kDefaultPluginLibraryName) - continue; plugin_paths->push_back(path); } @@ -489,10 +478,6 @@ void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) { #if defined(OS_WIN) GetPluginPathsFromRegistry(plugin_paths); #endif - - // Load the default plugin last. - if (default_plugin_enabled_) - plugin_paths->push_back(FilePath(kDefaultPluginLibraryName)); } void PluginList::SetPlugins(const std::vector<webkit::WebPluginInfo>& plugins) { @@ -565,8 +550,7 @@ void PluginList::GetPluginInfoArray( for (size_t i = 0; i < plugins.size(); ++i) { if (SupportsType(plugins[i], mime_type, allow_wildcard)) { FilePath path = plugins[i].path; - if (path.value() != kDefaultPluginLibraryName && - visited_plugins.insert(path).second) { + if (visited_plugins.insert(path).second) { info->push_back(plugins[i]); if (actual_mime_types) actual_mime_types->push_back(mime_type); @@ -587,8 +571,7 @@ void PluginList::GetPluginInfoArray( for (size_t i = 0; i < plugins.size(); ++i) { if (SupportsExtension(plugins[i], extension, &actual_mime_type)) { FilePath path = plugins[i].path; - if (path.value() != kDefaultPluginLibraryName && - visited_plugins.insert(path).second && + if (visited_plugins.insert(path).second && AllowMimeTypeMismatch(mime_type, actual_mime_type)) { info->push_back(plugins[i]); if (actual_mime_types) @@ -598,27 +581,6 @@ void PluginList::GetPluginInfoArray( } } } - - // Add the default plugin at the end if it supports the mime type given, - // and the default plugin is enabled. - for (size_t i = 0; i < plugin_groups_.size(); ++i) { -#if defined(OS_WIN) - if (plugin_groups_[i]->identifier().compare( - WideToUTF8(kDefaultPluginLibraryName)) == 0) { -#else - if (plugin_groups_[i]->identifier().compare( - kDefaultPluginLibraryName) == 0) { -#endif - DCHECK_NE(0U, plugin_groups_[i]->web_plugin_infos().size()); - const webkit::WebPluginInfo& default_info = - plugin_groups_[i]->web_plugin_infos()[0]; - if (SupportsType(default_info, mime_type, allow_wildcard)) { - info->push_back(default_info); - if (actual_mime_types) - actual_mime_types->push_back(mime_type); - } - } - } } void PluginList::GetPluginGroups( diff --git a/webkit/plugins/npapi/plugin_list.h b/webkit/plugins/npapi/plugin_list.h index e0df428..bff39c4 100644 --- a/webkit/plugins/npapi/plugin_list.h +++ b/webkit/plugins/npapi/plugin_list.h @@ -33,8 +33,6 @@ struct DefaultLazyInstanceTraits; namespace webkit { namespace npapi { -WEBKIT_PLUGINS_EXPORT extern FilePath::CharType kDefaultPluginLibraryName[]; - // This struct holds entry points into a plugin. The entry points are // slightly different between Win/Mac and Unixes. Note that the interface for // querying plugins is synchronous and it is preferable to use a higher-level @@ -139,8 +137,7 @@ class WEBKIT_PLUGINS_EXPORT PluginList { // The |allow_wildcard| parameter controls whether this function // returns plugins which support wildcard mime types (* as the mime // type). The |info| parameter is required to be non-NULL. The - // list is in order of "most desirable" to "least desirable", - // meaning that the default plugin is at the end of the list. + // list is in order of "most desirable" to "least desirable". // If |use_stale| is NULL, this will load the plug-in list if necessary. // If it is not NULL, the plug-in list will not be loaded, and |*use_stale| // will be true iff the plug-in list was stale. @@ -297,9 +294,6 @@ class WEBKIT_PLUGINS_EXPORT PluginList { // accessed on multiple threads. base::Lock lock_; - // Set to true if the default plugin is enabled. - bool default_plugin_enabled_; - DISALLOW_COPY_AND_ASSIGN(PluginList); }; |