Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6967)

Unified Diff: chrome/default_plugin/plugin_impl_win.cc

Issue 8473001: Show missing plug-in infobar only if a plug-in is available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/default_plugin/plugin_impl_mac.mm ('k') | chrome/default_plugin/plugin_installer_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/default_plugin/plugin_impl_win.cc
diff --git a/chrome/default_plugin/plugin_impl_win.cc b/chrome/default_plugin/plugin_impl_win.cc
index d61228b5435066ceac471f9b5881695493f8c8f4..890a36530c062b2b55d80a1aacf5d992936ccabb 100644
--- a/chrome/default_plugin/plugin_impl_win.cc
+++ b/chrome/default_plugin/plugin_impl_win.cc
@@ -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;
}
« no previous file with comments | « chrome/default_plugin/plugin_impl_mac.mm ('k') | chrome/default_plugin/plugin_installer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698