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

Unified Diff: chrome/browser/plugin_observer.cc

Issue 9536013: Move |requires_authorization| flag for plug-ins out of webkit/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright 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 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;
« 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