Chromium Code Reviews| 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..cf08aa48be05b152a8c02b36751654788a5e1965 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; |
| @@ -492,24 +496,24 @@ void LaunchDesktopInstanceHelper(const string16& url) { |
| if (!PathService::Get(base::FILE_EXE, &exe_path)) |
| return; |
| base::FilePath shortcut_path( |
|
sky
2013/08/30 17:06:56
nit: 4 space indent is correct here (meaning don't
zturner
2013/08/30 18:10:05
Done.
|
| - ShellIntegration::GetStartMenuShortcut(exe_path)); |
| + ShellIntegration::GetStartMenuShortcut(exe_path)); |
| + |
| + string16 shortcut = shortcut_path.AsUTF16Unsafe(); |
| - 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( |
|
sky
2013/08/30 17:06:56
What about non-aura?
zturner
2013/08/30 17:14:44
This function is only used as a helper function fr
zturner
2013/08/30 18:10:06
Done.
|
| + shortcut, url); |
| } |
| 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 |