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

Unified Diff: chrome/browser/plugins/plugin_observer.cc

Issue 10917189: Remove PluginFinder async interface (Closed) Base URL: http://git.chromium.org/chromium/src.git@separate_finder_thread_safety
Patch Set: ... Created 8 years, 3 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/browser/plugins/plugin_observer.cc
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc
index 9c7d3c33fcee8076031ac8747df672beea4c6e5c..27493333d27086ba5f70dac99d12fc16b73b7c86 100644
--- a/chrome/browser/plugins/plugin_observer.cc
+++ b/chrome/browser/plugins/plugin_observer.cc
@@ -232,22 +232,9 @@ void PluginObserver::OnBlockedUnauthorizedPlugin(
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));
-#else
- // If we don't support third-party plug-in installation, we shouldn't have
- // outdated plug-ins.
- NOTREACHED();
-#endif // defined(ENABLE_PLUGIN_INSTALLATION)
-}
-
-#if defined(ENABLE_PLUGIN_INSTALLATION)
-void PluginObserver::FindPluginToUpdate(int placeholder_id,
- const std::string& identifier,
- PluginFinder* plugin_finder) {
+ // Find plugin to update.
PluginInstaller* installer =
- plugin_finder->FindPluginWithIdentifier(identifier);
+ PluginFinder::GetInstance()->FindPluginWithIdentifier(identifier);
DCHECK(installer) << "Couldn't find PluginInstaller for identifier "
<< identifier;
plugin_placeholders_[placeholder_id] =
@@ -256,20 +243,19 @@ void PluginObserver::FindPluginToUpdate(int placeholder_id,
InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper();
infobar_helper->AddInfoBar(
OutdatedPluginInfoBarDelegate::Create(web_contents(), installer));
+#else
+ // If we don't support third-party plug-in installation, we shouldn't have
+ // outdated plug-ins.
+ NOTREACHED();
+#endif // defined(ENABLE_PLUGIN_INSTALLATION)
}
+#if defined(ENABLE_PLUGIN_INSTALLATION)
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));
-}
-
-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);
+ PluginInstaller* installer =
+ PluginFinder::GetInstance()->FindPlugin(mime_type, lang);
if (!installer) {
Send(new ChromeViewMsg_DidNotFindMissingPlugin(placeholder_id));
return;
« no previous file with comments | « chrome/browser/plugins/plugin_observer.h ('k') | chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698