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

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

Issue 62373004: Move the Ash NPAPI plugin blocker logic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/plugins/plugin_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_observer.cc
===================================================================
--- chrome/browser/plugins/plugin_observer.cc (revision 233357)
+++ chrome/browser/plugins/plugin_observer.cc (working copy)
@@ -182,6 +182,31 @@
#endif
}
+void PluginObserver::RenderViewCreated(
+ content::RenderViewHost* render_view_host) {
+#if defined(USE_AURA) && defined(OS_WIN)
+ // If the window belongs to the Ash desktop, before we navigate we need
+ // to tell the renderview that NPAPI plugins are not supported so it does
+ // not try to instantiate them. The final decision is actually done in
+ // the IO thread by PluginInfoMessageFilter of this proces,s but it's more
+ // complex to manage a map of Ash views in PluginInfoMessageFilter than
+ // just telling the renderer via IPC.
+ if (!web_contents())
jam 2013/11/07 00:13:07 this won't happen, so no need to check for this
+ return;
+
+ content::WebContentsView* wcv = web_contents()->GetView();
+ if (!wcv)
jam 2013/11/07 00:13:07 ditto
+ return;
+
+ aura::Window* window = wcv->GetNativeView();
+ if (chrome::GetHostDesktopTypeForNativeView(window) ==
+ chrome::HOST_DESKTOP_TYPE_ASH) {
+ int routing_id = render_view_host->GetRoutingID();
+ render_view_host->Send(new ChromeViewMsg_NPAPINotSupported(routing_id));
+ }
+#endif
+}
+
void PluginObserver::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
DCHECK(!plugin_path.value().empty());
@@ -254,31 +279,6 @@
return true;
}
-void PluginObserver::AboutToNavigateRenderView(
- content::RenderViewHost* render_view_host) {
-#if defined(USE_AURA) && defined(OS_WIN)
- // If the window belongs to the Ash desktop, before we navigate we need
- // to tell the renderview that NPAPI plugins are not supported so it does
- // not try to instantiate them. The final decision is actually done in
- // the IO thread by PluginInfoMessageFilter of this proces,s but it's more
- // complex to manage a map of Ash views in PluginInfoMessageFilter than
- // just telling the renderer via IPC.
- if (!web_contents())
- return;
-
- content::WebContentsView* wcv = web_contents()->GetView();
- if (!wcv)
- return;
-
- aura::Window* window = wcv->GetNativeView();
- if (chrome::GetHostDesktopTypeForNativeView(window) ==
- chrome::HOST_DESKTOP_TYPE_ASH) {
- int routing_id = render_view_host->GetRoutingID();
- render_view_host->Send(new ChromeViewMsg_NPAPINotSupported(routing_id));
- }
-#endif
-}
-
void PluginObserver::OnBlockedUnauthorizedPlugin(
const string16& name,
const std::string& identifier) {
« no previous file with comments | « chrome/browser/plugins/plugin_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698