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

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

Issue 23592024: Make the metro viewer responsible for relaunching browser in desktop mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a few nits. Created 7 years, 3 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 | « no previous file | ui/aura/remote_root_window_host_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_infobar_delegates.cc
diff --git a/chrome/browser/plugins/plugin_infobar_delegates.cc b/chrome/browser/plugins/plugin_infobar_delegates.cc
index e4a26518266539ba324d83099ba51e18ae2896de..afb3defdd4343fe3eee657c7e378290c72d0c8f1 100644
--- a/chrome/browser/plugins/plugin_infobar_delegates.cc
+++ b/chrome/browser/plugins/plugin_infobar_delegates.cc
@@ -37,6 +37,10 @@
#if defined(OS_WIN)
#include <shellapi.h>
#include "ui/base/win/shell.h"
+
+#if defined(USE_AURA)
+#include "ui/aura/remote_root_window_host_win.h"
+#endif
#endif
using content::UserMetricsAction;
@@ -487,6 +491,7 @@ string16 PluginMetroModeInfoBarDelegate::GetButtonLabel(
IDS_WIN8_DESKTOP_RESTART : IDS_WIN8_RESTART);
}
+#if defined(USE_AURA) && defined(USE_ASH)
void LaunchDesktopInstanceHelper(const string16& url) {
base::FilePath exe_path;
if (!PathService::Get(base::FILE_EXE, &exe_path))
@@ -494,22 +499,21 @@ void LaunchDesktopInstanceHelper(const string16& url) {
base::FilePath shortcut_path(
ShellIntegration::GetStartMenuShortcut(exe_path));
- SHELLEXECUTEINFO sei = { sizeof(sei) };
- sei.fMask = SEE_MASK_FLAG_LOG_USAGE;
- sei.nShow = SW_SHOWNORMAL;
- sei.lpFile = shortcut_path.value().c_str();
- sei.lpDirectory = L"";
- sei.lpParameters = url.c_str();
- ShellExecuteEx(&sei);
+ // Actually launching the process needs to happen in the metro viewer,
+ // otherwise it won't automatically transition to desktop. So we have
+ // to send an IPC to the viewer to do the ShellExecute.
+ aura::RemoteRootWindowHostWin::Instance()->HandleOpenURLOnDesktop(
+ shortcut_path, url);
}
+#endif
bool PluginMetroModeInfoBarDelegate::Accept() {
#if defined(USE_AURA) && defined(USE_ASH)
- // We need to PostTask as there is some IO involved.
- content::BrowserThread::PostTask(
- content::BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
- base::Bind(&LaunchDesktopInstanceHelper,
- UTF8ToUTF16(web_contents()->GetURL().spec())));
+ // We need to PostTask as there is some IO involved.
+ content::BrowserThread::PostTask(
+ content::BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
+ base::Bind(&LaunchDesktopInstanceHelper,
+ UTF8ToUTF16(web_contents()->GetURL().spec())));
#else
chrome::AttemptRestartWithModeSwitch();
#endif
« no previous file with comments | « no previous file | ui/aura/remote_root_window_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698