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

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

Issue 11066043: Block NPAPI plug-ins in Metro mode instead of not loading them at all. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 50a4ea55dd11019b2d9d98a3e69887e8feacf219..32a556b04d8bdf360c815c0e56896ffe3e29a47c 100644
--- a/chrome/browser/plugins/plugin_observer.cc
+++ b/chrome/browser/plugins/plugin_observer.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/infobars/infobar_tab_helper.h"
+#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/plugins/plugin_finder.h"
#include "chrome/browser/plugins/plugin_infobar_delegates.h"
@@ -216,6 +217,10 @@ bool PluginObserver::OnMessageReceived(const IPC::Message& message) {
OnOpenAboutPlugins)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin,
OnCouldNotLoadPlugin)
+#if defined(OS_WIN)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RestartInDesktopMode,
+ OnRestartInDesktopMode)
+#endif
IPC_MESSAGE_UNHANDLED(return false)
IPC_END_MESSAGE_MAP()
@@ -288,21 +293,10 @@ void PluginObserver::OnFindMissingPlugin(int placeholder_id,
base::Passed(plugin_metadata->Clone()));
InfoBarTabHelper* infobar_helper =
InfoBarTabHelper::FromWebContents(web_contents());
- InfoBarDelegate* delegate;
-#if !defined(OS_WIN)
- delegate = PluginInstallerInfoBarDelegate::Create(
+ InfoBarDelegate* delegate = PluginInstallerInfoBarDelegate::Create(
infobar_helper, installer,
plugin_metadata.Pass(),
callback);
-#else
- delegate = base::win::IsMetroProcess() ?
- PluginMetroModeInfoBarDelegate::Create(
- infobar_helper, plugin_metadata->name()) :
- PluginInstallerInfoBarDelegate::Create(
- infobar_helper, installer,
- plugin_metadata.Pass(),
- callback);
-#endif
infobar_helper->AddInfoBar(delegate);
}
@@ -354,3 +348,9 @@ void PluginObserver::OnCouldNotLoadPlugin(const FilePath& plugin_path) {
true /* auto_expire */));
}
+#if defined(OS_WIN)
+void PluginObserver::OnRestartInDesktopMode() {
+ DCHECK(base::win::IsMetroProcess());
+ browser::AttemptRestartWithModeSwitch();
+}
+#endif

Powered by Google App Engine
This is Rietveld 408576698