diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 20:46:46 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 20:46:46 +0000 |
commit | 537701536f61f2afb07b6d6f6c7cccb904d17e75 (patch) | |
tree | 49df8199dcf94307aaf25c120c88cad8bd5c9d63 /chrome/default_plugin | |
parent | 19d52a946257259d32d46a5cb3ceb4b551bb6600 (diff) | |
download | chromium_src-537701536f61f2afb07b6d6f6c7cccb904d17e75.zip chromium_src-537701536f61f2afb07b6d6f6c7cccb904d17e75.tar.gz chromium_src-537701536f61f2afb07b6d6f6c7cccb904d17e75.tar.bz2 |
Show missing plug-in infobar only if a plug-in is available.
BUG=101821
TEST=see bug
Review URL: http://codereview.chromium.org/8473001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/default_plugin')
-rw-r--r-- | chrome/default_plugin/plugin_impl_aura.cc | 4 | ||||
-rw-r--r-- | chrome/default_plugin/plugin_impl_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/default_plugin/plugin_impl_mac.mm | 4 | ||||
-rw-r--r-- | chrome/default_plugin/plugin_impl_win.cc | 20 | ||||
-rw-r--r-- | chrome/default_plugin/plugin_installer_base.cc | 7 | ||||
-rw-r--r-- | chrome/default_plugin/plugin_installer_base.h | 5 |
6 files changed, 24 insertions, 22 deletions
diff --git a/chrome/default_plugin/plugin_impl_aura.cc b/chrome/default_plugin/plugin_impl_aura.cc index cdf8ffb..4122854 100644 --- a/chrome/default_plugin/plugin_impl_aura.cc +++ b/chrome/default_plugin/plugin_impl_aura.cc @@ -36,8 +36,8 @@ bool PluginInstallerImpl::Initialize(void* module_handle, return false; } - return PluginInstallerBase::Initialize(module_handle, instance, mime_type, - argc, argn, argv); + PluginInstallerBase::SetRoutingIds(argc, argn, argv); + return true; } bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { diff --git a/chrome/default_plugin/plugin_impl_gtk.cc b/chrome/default_plugin/plugin_impl_gtk.cc index e39a001..0da5f30 100644 --- a/chrome/default_plugin/plugin_impl_gtk.cc +++ b/chrome/default_plugin/plugin_impl_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -49,8 +49,8 @@ bool PluginInstallerImpl::Initialize(void* module_handle, NPP instance, instance_ = instance; mime_type_ = mime_type; - return PluginInstallerBase::Initialize(module_handle, instance, mime_type, - argc, argn, argv); + PluginInstallerBase::SetRoutingIds(argc, argn, argv); + return true; } bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { diff --git a/chrome/default_plugin/plugin_impl_mac.mm b/chrome/default_plugin/plugin_impl_mac.mm index 927c32f..36a7dfd 100644 --- a/chrome/default_plugin/plugin_impl_mac.mm +++ b/chrome/default_plugin/plugin_impl_mac.mm @@ -57,8 +57,8 @@ bool PluginInstallerImpl::Initialize(void* module_handle, NPP instance, ResourceBundle& rb = ResourceBundle::GetSharedInstance(); image_ = rb.GetNativeImageNamed(IDR_PLUGIN_ICON); - return PluginInstallerBase::Initialize(module_handle, instance, mime_type, - argc, argn, argv); + PluginInstallerBase::SetRoutingIds(argc, argn, argv); + return true; } bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { diff --git a/chrome/default_plugin/plugin_impl_win.cc b/chrome/default_plugin/plugin_impl_win.cc index d61228b..595e404 100644 --- a/chrome/default_plugin/plugin_impl_win.cc +++ b/chrome/default_plugin/plugin_impl_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -87,6 +87,9 @@ bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance, 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"; @@ -98,8 +101,7 @@ bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance, } else { DisplayStatus(IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_PLUGIN_FINDER_DISABLED); } - return PluginInstallerBase::Initialize(module_handle, instance, mime_type, - argc, argn, argv); + return true; } void PluginInstallerImpl::Shutdown() { @@ -265,6 +267,12 @@ void PluginInstallerImpl::URLNotify(const char* url, NPReason reason) { if (plugin_available) { DVLOG(1) << "Plugin available for mime type " << mime_type_; + // Show the infobar only once. + if (show_install_infobar_) { + show_install_infobar_ = false; + NotifyPluginStatus( + webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE); + } DisplayAvailablePluginStatus(); } else { DLOG(WARNING) << "No plugin available for mime type " << mime_type_; @@ -328,12 +336,6 @@ bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { UpdateWindow(hwnd()); ShowWindow(hwnd(), SW_SHOW); - // Show the infobar only once. - if (show_install_infobar_) { - show_install_infobar_ = false; - NotifyPluginStatus( - webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE); - } return true; } diff --git a/chrome/default_plugin/plugin_installer_base.cc b/chrome/default_plugin/plugin_installer_base.cc index 9488b4d..8326bcb 100644 --- a/chrome/default_plugin/plugin_installer_base.cc +++ b/chrome/default_plugin/plugin_installer_base.cc @@ -16,9 +16,9 @@ PluginInstallerBase::PluginInstallerBase() PluginInstallerBase::~PluginInstallerBase() { } -bool PluginInstallerBase::Initialize(void* module_handle, NPP instance, - NPMIMEType mime_type, int16 argc, - char* argn[], char* argv[]) { +void PluginInstallerBase::SetRoutingIds(int16 argc, + char* argn[], + char* argv[]) { for (int16_t index = 0; index < argc; ++index) { if (!base::strncasecmp(argn[index], content::kDefaultPluginRenderProcessId, @@ -30,5 +30,4 @@ bool PluginInstallerBase::Initialize(void* module_handle, NPP instance, base::StringToInt(argv[index], &render_view_id_); } } - return true; } diff --git a/chrome/default_plugin/plugin_installer_base.h b/chrome/default_plugin/plugin_installer_base.h index 928ad10..1f20a68 100644 --- a/chrome/default_plugin/plugin_installer_base.h +++ b/chrome/default_plugin/plugin_installer_base.h @@ -14,8 +14,9 @@ class PluginInstallerBase { PluginInstallerBase(); virtual ~PluginInstallerBase(); - bool Initialize(void* module_handle, NPP instance, NPMIMEType mime_type, - int16 argc, char* argn[], char* argv[]); + // 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_; |