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

Unified Diff: chrome/browser/plugin_finder.cc

Issue 8664027: Add PluginInstaller to encapsulate information about a missing plug-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 1 month 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/plugin_finder.cc
diff --git a/chrome/browser/plugin_finder.cc b/chrome/browser/plugin_finder.cc
index eee77570c6632e47bd2d0cc4ba36ca53616dcff5..347eb29d44d41f0bd875d1bdd7f4872758b2c257 100644
--- a/chrome/browser/plugin_finder.cc
+++ b/chrome/browser/plugin_finder.cc
@@ -9,6 +9,7 @@
#include "base/message_loop.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/plugin_installer.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
@@ -81,17 +82,29 @@ void PluginFinder::FindPlugin(
success = (*mime_type_it)->GetAsString(&mime_type_str);
DCHECK(success);
if (mime_type_str == mime_type) {
- std::string url;
- success = plugin->GetString("url", &url);
+ std::string identifier;
+ success = plugin->GetString("identifier", &identifier);
DCHECK(success);
- string16 name;
- success = plugin->GetString("name", &name);
- DCHECK(success);
- bool display_url = false;
- plugin->GetBoolean("displayurl", &display_url);
+ PluginInstaller* installer = installers_[identifier];
+ if (!installer) {
+ std::string url;
+ success = plugin->GetString("url", &url);
+ DCHECK(success);
+ std::string help_url;
+ plugin->GetString("help_url", &help_url);
+ string16 name;
+ success = plugin->GetString("name", &name);
+ DCHECK(success);
+ bool display_url = false;
+ plugin->GetBoolean("displayurl", &display_url);
+ installer = new PluginInstaller(identifier,
+ GURL(url), GURL(help_url), name,
+ display_url);
+ installers_[identifier] = installer;
battre 2011/11/30 14:10:06 do you need to free the installers_ in the destruc
Bernhard Bauer 2011/11/30 14:29:23 True, there might be circumstances where we destro
Bernhard Bauer 2011/12/01 09:39:25 Done.
+ }
MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(found_callback, GURL(url), name, display_url));
+ base::Bind(found_callback, installer));
battre 2011/11/30 14:10:06 once you free the installers_ int he destructor yo
Bernhard Bauer 2011/11/30 14:29:23 Hm, during normal browser runs I think it's reason
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698