Chromium Code Reviews| 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 cb767b0b51201562e951e53ab773e52340f8da1d..1c836f42251e2962918ba3d5404ff4fcb5781e18 100644 |
| --- a/chrome/default_plugin/plugin_impl_win.cc |
| +++ b/chrome/default_plugin/plugin_impl_win.cc |
| @@ -22,6 +22,7 @@ static const int TOOLTIP_MAX_WIDTH = 500; |
| PluginInstallerImpl::PluginInstallerImpl(int16 mode) |
| : instance_(NULL), |
| mode_(mode), |
| + disable_plugin_finder_(false), |
| plugin_install_stream_(NULL), |
| plugin_installer_state_(PluginInstallerStateUndefined), |
| install_dialog_(NULL), |
| @@ -38,7 +39,8 @@ PluginInstallerImpl::PluginInstallerImpl(int16 mode) |
| } |
| PluginInstallerImpl::~PluginInstallerImpl() { |
| - installation_job_monitor_thread_->Stop(); |
| + if (!disable_plugin_finder_) |
| + installation_job_monitor_thread_->Stop(); |
| if (bold_font_) |
| DeleteObject(bold_font_); |
| @@ -72,16 +74,23 @@ bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance, |
| return false; |
| } |
| - if (!installation_job_monitor_thread_->Initialize()) { |
| - DLOG(ERROR) << "Failed to initialize plugin install job"; |
| - NOTREACHED(); |
| - return false; |
| - } |
| + if (plugin_finder_url_.empty()) |
| + disable_plugin_finder_ = true; |
| InitializeResources(module_handle); |
| - DisplayStatus(IDS_DEFAULT_PLUGIN_GET_PLUGIN_MSG_NO_PLUGIN_NAME); |
| - plugin_database_handler_.DownloadPluginsFileIfNeeded(plugin_finder_url_); |
| + if (!disable_plugin_finder_) { |
| + if (!installation_job_monitor_thread_->Initialize()) { |
| + DLOG(ERROR) << "Failed to initialize plugin install job"; |
|
Bernhard Bauer
2011/02/24 10:37:07
You can just |DLOG(FATAL)| here, or even simpler j
pastarmovj
2011/02/24 16:02:20
Actually I only moved this piece of code but i wil
Bernhard Bauer
2011/02/24 16:25:18
Please do. Even if you're not the original author
pastarmovj
2011/02/25 09:56:37
Yep sure. :)
|
| + NOTREACHED(); |
| + 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; |
| } |