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

Unified Diff: chrome/browser/plugin_observer.cc

Issue 9874001: revert 128949 (and dependent 129252) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/browser/plugin_observer.h ('k') | chrome/browser/renderer_host/plugin_info_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_observer.cc
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index 25fd4af69f543e9d6a4cd87c39d9633b9325461d..3660d2f723a1dbd38b07ef651214c386e8d28b2b 100644
--- a/chrome/browser/plugin_observer.cc
+++ b/chrome/browser/plugin_observer.cc
@@ -118,7 +118,6 @@ 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_,
@@ -202,9 +201,11 @@ void PluginObserver::OnBlockedUnauthorizedPlugin(const string16& name) {
void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id,
const std::string& identifier) {
#if defined(ENABLE_PLUGIN_INSTALLATION)
- PluginFinder::Get(base::Bind(&PluginObserver::FindPluginToUpdate,
- weak_ptr_factory_.GetWeakPtr(),
- placeholder_id, identifier));
+ PluginFinder* plugin_finder = PluginFinder::GetInstance();
+ plugin_finder->FindPluginWithIdentifier(
+ identifier,
+ base::Bind(&PluginObserver::FoundPluginToUpdate,
+ weak_ptr_factory_.GetWeakPtr(), placeholder_id));
#else
// If we don't support third-party plug-in installation, we shouldn't have
// outdated plug-ins.
@@ -213,11 +214,8 @@ void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id,
}
#if defined(ENABLE_PLUGIN_INSTALLATION)
-void PluginObserver::FindPluginToUpdate(int placeholder_id,
- const std::string& identifier,
- PluginFinder* plugin_finder) {
- PluginInstaller* installer =
- plugin_finder->FindPluginWithIdentifier(identifier);
+void PluginObserver::FoundPluginToUpdate(int placeholder_id,
+ PluginInstaller* installer) {
plugin_placeholders_[placeholder_id] =
new PluginPlaceholderHost(this, placeholder_id, installer);
InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper();
@@ -227,16 +225,17 @@ void PluginObserver::FindPluginToUpdate(int placeholder_id,
void PluginObserver::OnFindMissingPlugin(int placeholder_id,
const std::string& mime_type) {
-PluginFinder::Get(base::Bind(&PluginObserver::FindMissingPlugin,
- weak_ptr_factory_.GetWeakPtr(),
- placeholder_id, 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));
}
-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);
+void PluginObserver::FoundMissingPlugin(int placeholder_id,
+ const std::string& mime_type,
+ PluginInstaller* installer) {
if (!installer) {
Send(new ChromeViewMsg_DidNotFindMissingPlugin(placeholder_id));
return;
« no previous file with comments | « chrome/browser/plugin_observer.h ('k') | chrome/browser/renderer_host/plugin_info_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698