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 |