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

Unified Diff: chrome/default_plugin/plugin_impl_win.cc

Issue 6475011: Implemented policy to disable plugin finder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Finished the policy implementation. Created 9 years, 10 months 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
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";
+ 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;
}

Powered by Google App Engine
This is Rietveld 408576698