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

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

Issue 104833006: Switch ContentSettingsObserver to be a RenderFrameObserver instead of a RenderViewObserver (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years 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/chrome_plugin_service_filter.cc
===================================================================
--- chrome/browser/plugins/chrome_plugin_service_filter.cc (revision 241294)
+++ chrome/browser/plugins/chrome_plugin_service_filter.cc (working copy)
@@ -4,21 +4,34 @@
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
+#include "base/bind.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/plugins/plugin_metadata.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/render_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/plugin_service.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/resource_context.h"
+#include "content/public/browser/web_contents.h"
using content::BrowserThread;
using content::PluginService;
+namespace {
+
+void AuthorizeRenderer(content::RenderFrameHost* render_frame_host) {
+ ChromePluginServiceFilter::GetInstance()->AuthorizePlugin(
+ render_frame_host->GetProcess()->GetID(), base::FilePath());
+}
+
+}
+
// static
ChromePluginServiceFilter* ChromePluginServiceFilter::GetInstance() {
return Singleton<ChromePluginServiceFilter>::get();
@@ -156,8 +169,16 @@
details->authorized_plugins.insert(plugin_path);
}
-void ChromePluginServiceFilter::AuthorizeAllPlugins(int render_process_id) {
- AuthorizePlugin(render_process_id, base::FilePath());
+void ChromePluginServiceFilter::AuthorizeAllPlugins(
+ content::WebContents* web_contents,
+ bool load_blocked,
+ const std::string& identifier) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ web_contents->ForEachFrame(base::Bind(&AuthorizeRenderer));
+ if (load_blocked) {
+ web_contents->SendToAllFrames(new ChromeViewMsg_LoadBlockedPlugins(
+ MSG_ROUTING_NONE, identifier));
+ }
}
ChromePluginServiceFilter::ChromePluginServiceFilter() {
« no previous file with comments | « chrome/browser/plugins/chrome_plugin_service_filter.h ('k') | chrome/browser/plugins/plugin_infobar_delegates.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698