Index: chrome/browser/plugin_observer.cc |
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc |
index 3660d2f723a1dbd38b07ef651214c386e8d28b2b..25fd4af69f543e9d6a4cd87c39d9633b9325461d 100644 |
--- a/chrome/browser/plugin_observer.cc |
+++ b/chrome/browser/plugin_observer.cc |
@@ -118,6 +118,7 @@ class PluginObserver::PluginPlaceholderHost : public PluginInstallerObserver { |
: PluginInstallerObserver(installer), |
observer_(observer), |
routing_id_(routing_id) { |
+ DCHECK(installer); |
switch (installer->state()) { |
case PluginInstaller::kStateIdle: { |
observer->Send(new ChromeViewMsg_FoundMissingPlugin(routing_id_, |
@@ -201,11 +202,9 @@ void PluginObserver::OnBlockedUnauthorizedPlugin(const string16& name) { |
void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, |
const std::string& identifier) { |
#if defined(ENABLE_PLUGIN_INSTALLATION) |
- PluginFinder* plugin_finder = PluginFinder::GetInstance(); |
- plugin_finder->FindPluginWithIdentifier( |
- identifier, |
- base::Bind(&PluginObserver::FoundPluginToUpdate, |
- weak_ptr_factory_.GetWeakPtr(), placeholder_id)); |
+ PluginFinder::Get(base::Bind(&PluginObserver::FindPluginToUpdate, |
+ weak_ptr_factory_.GetWeakPtr(), |
+ placeholder_id, identifier)); |
#else |
// If we don't support third-party plug-in installation, we shouldn't have |
// outdated plug-ins. |
@@ -214,8 +213,11 @@ void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, |
} |
#if defined(ENABLE_PLUGIN_INSTALLATION) |
-void PluginObserver::FoundPluginToUpdate(int placeholder_id, |
- PluginInstaller* installer) { |
+void PluginObserver::FindPluginToUpdate(int placeholder_id, |
+ const std::string& identifier, |
+ PluginFinder* plugin_finder) { |
+ PluginInstaller* installer = |
+ plugin_finder->FindPluginWithIdentifier(identifier); |
plugin_placeholders_[placeholder_id] = |
new PluginPlaceholderHost(this, placeholder_id, installer); |
InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper(); |
@@ -225,17 +227,16 @@ void PluginObserver::FoundPluginToUpdate(int placeholder_id, |
void PluginObserver::OnFindMissingPlugin(int placeholder_id, |
const std::string& mime_type) { |
- PluginFinder* plugin_finder = PluginFinder::GetInstance(); |
- std::string lang = "en-US"; // Oh yes. |
- plugin_finder->FindPlugin( |
- mime_type, lang, |
- base::Bind(&PluginObserver::FoundMissingPlugin, |
- weak_ptr_factory_.GetWeakPtr(), placeholder_id, mime_type)); |
+PluginFinder::Get(base::Bind(&PluginObserver::FindMissingPlugin, |
+ weak_ptr_factory_.GetWeakPtr(), |
+ placeholder_id, mime_type)); |
} |
-void PluginObserver::FoundMissingPlugin(int placeholder_id, |
- const std::string& mime_type, |
- PluginInstaller* installer) { |
+void PluginObserver::FindMissingPlugin(int placeholder_id, |
+ const std::string& mime_type, |
+ PluginFinder* plugin_finder) { |
+ std::string lang = "en-US"; // Oh yes. |
+ PluginInstaller* installer = plugin_finder->FindPlugin(mime_type, lang); |
if (!installer) { |
Send(new ChromeViewMsg_DidNotFindMissingPlugin(placeholder_id)); |
return; |