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

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: Created 7 years, 4 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') | ui/aura/remote_root_window_host_win.cc » ('J')
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..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
« no previous file with comments | « no previous file | ui/aura/remote_root_window_host_win.h » ('j') | ui/aura/remote_root_window_host_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698