diff options
author | pastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-25 12:36:37 +0000 |
---|---|---|
committer | pastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-25 12:36:37 +0000 |
commit | 8b08a47f878f0ed77508d6c49bf4e593ea8f2bef (patch) | |
tree | 7575f86aa79e27ce1bb9c61a272c11dde474da6a /chrome/default_plugin | |
parent | 0f38dc4551ef947f74259b3e7c92b984bf554c60 (diff) | |
download | chromium_src-8b08a47f878f0ed77508d6c49bf4e593ea8f2bef.zip chromium_src-8b08a47f878f0ed77508d6c49bf4e593ea8f2bef.tar.gz chromium_src-8b08a47f878f0ed77508d6c49bf4e593ea8f2bef.tar.bz2 |
Implemented policy to disable plugin finder.
BUG=49597
TEST=Set the policy to true and the default plugin should not offer to install missing plugins.
Review URL: http://codereview.chromium.org/6475011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76043 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/default_plugin')
-rw-r--r-- | chrome/default_plugin/plugin_impl_win.cc | 30 | ||||
-rw-r--r-- | chrome/default_plugin/plugin_impl_win.h | 2 |
2 files changed, 20 insertions, 12 deletions
diff --git a/chrome/default_plugin/plugin_impl_win.cc b/chrome/default_plugin/plugin_impl_win.cc index cb767b0..c6ef4c6 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; } diff --git a/chrome/default_plugin/plugin_impl_win.h b/chrome/default_plugin/plugin_impl_win.h index 242d9f0..78bcbbf 100644 --- a/chrome/default_plugin/plugin_impl_win.h +++ b/chrome/default_plugin/plugin_impl_win.h @@ -271,6 +271,8 @@ class PluginInstallerImpl : public ui::WindowImpl { std::wstring command_; // An additional message displayed at times by the plugin. std::wstring optional_additional_message_; + // Set to true if plugin finder has been disabled. + bool disable_plugin_finder_; // The current stream. NPStream* plugin_install_stream_; // The plugin finder URL. |