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

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: Merged ToT and addressed comments. 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
« no previous file with comments | « chrome/default_plugin/plugin_impl_win.h ('k') | chrome/plugin/plugin_thread.cc » ('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 cb767b0b51201562e951e53ab773e52340f8da1d..c6ef4c6963374eb3897ddbac1c3e21f33017ef06 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_);
@@ -58,8 +60,7 @@ bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance,
DCHECK(module_handle != NULL);
if (mime_type == NULL || strlen(mime_type) == 0) {
- DLOG(WARNING) << __FUNCTION__ << " Invalid parameters passed in";
- NOTREACHED();
+ NOTREACHED() << __FUNCTION__ << " Invalid parameters passed in";
return false;
}
@@ -67,21 +68,26 @@ bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance,
mime_type_ = mime_type;
if (!webkit_glue::GetPluginFinderURL(&plugin_finder_url_)) {
- NOTREACHED();
- DLOG(WARNING) << __FUNCTION__ << " Failed to get the plugin finder URL";
+ NOTREACHED() << __FUNCTION__ << " Failed to get the plugin finder URL";
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()) {
+ 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;
}
« no previous file with comments | « chrome/default_plugin/plugin_impl_win.h ('k') | chrome/plugin/plugin_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698