summaryrefslogtreecommitdiffstats
path: root/win8/metro_driver
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-05 21:44:34 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-05 21:44:34 +0000
commitb9503276adc3f736b9a2c07116297fbfaf9a96fb (patch)
tree36b218b0532590cf1d54f1c9b51984e1e0cd2db3 /win8/metro_driver
parent3fae4c589cc60e1b43a618d6e4bfdd078da507d1 (diff)
downloadchromium_src-b9503276adc3f736b9a2c07116297fbfaf9a96fb.zip
chromium_src-b9503276adc3f736b9a2c07116297fbfaf9a96fb.tar.gz
chromium_src-b9503276adc3f736b9a2c07116297fbfaf9a96fb.tar.bz2
Ensure that the Chrome downloads folder option in Chrome ASH on Windows switches to desktop mode while opening the
downloads folder. The current behavior is that the downloads folder is opened on the desktop while the user continues to stay in ASH mode leading to confusion. To fix this we reuse the ActivateDesktopHelper function in application_lifetime_win.cc. This function takes a boolean parameter now which indicates if we should be exiting ash after activating the desktop. This flag is true when we launch desktop chrome from ASH and is false when invoked to open the downloads folder via the functions in platform_util_win.cc. The MetroViewerHostMsg_ActivateDesktop IPC now has a flag which indicates if we should exit ash after activating desktop. If this flag is false we terminate the delegate_execute process which was launched to switch to desktop. Fixes bug https://code.google.com/p/chromium/issues/detail?id=324252 BUG=324252 R=cpu@chromium.org, jschuh@chromium.org, sky@chromium.org, cpu Review URL: https://codereview.chromium.org/102603006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/metro_driver')
-rw-r--r--win8/metro_driver/chrome_app_view_ash.cc21
-rw-r--r--win8/metro_driver/chrome_app_view_ash.h2
2 files changed, 16 insertions, 7 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index c557bb5..2e96a00 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -185,11 +185,11 @@ class ChromeChannelListener : public IPC::Listener {
}
private:
- void OnActivateDesktop(const base::FilePath& shortcut) {
+ void OnActivateDesktop(const base::FilePath& shortcut, bool ash_exit) {
ui_proxy_->PostTask(FROM_HERE,
base::Bind(&ChromeAppViewAsh::OnActivateDesktop,
base::Unretained(app_view_),
- shortcut));
+ shortcut, ash_exit));
}
void OnOpenURLOnDesktop(const base::FilePath& shortcut,
@@ -676,12 +676,15 @@ HRESULT ChromeAppViewAsh::Unsnap() {
return hr;
}
-void ChromeAppViewAsh::OnActivateDesktop(const base::FilePath& file_path) {
+void ChromeAppViewAsh::OnActivateDesktop(const base::FilePath& file_path,
+ bool ash_exit) {
DVLOG(1) << "ChannelAppViewAsh::OnActivateDesktop\n";
- // As we are the top level window, the exiting is done async so we manage
- // to execute the entire function including the final Send().
- MetroExit(core_window_hwnd());
+ if (ash_exit) {
+ // As we are the top level window, the exiting is done async so we manage
+ // to execute the entire function including the final Send().
+ MetroExit(core_window_hwnd());
+ }
// We are just executing delegate_execute here without parameters. Assumption
// here is that this process will be reused by shell when asking for
@@ -695,7 +698,13 @@ void ChromeAppViewAsh::OnActivateDesktop(const base::FilePath& file_path) {
sei.nShow = SW_SHOWNORMAL;
sei.lpFile = file_path.value().c_str();
sei.lpParameters = NULL;
+ if (!ash_exit)
+ sei.fMask |= SEE_MASK_NOCLOSEPROCESS;
::ShellExecuteExW(&sei);
+ if (!ash_exit) {
+ ::TerminateProcess(sei.hProcess, 0);
+ ::CloseHandle(sei.hProcess);
+ }
ui_channel_->Send(new MetroViewerHostMsg_ActivateDesktopDone());
}
diff --git a/win8/metro_driver/chrome_app_view_ash.h b/win8/metro_driver/chrome_app_view_ash.h
index d50255b..c2e6d42 100644
--- a/win8/metro_driver/chrome_app_view_ash.h
+++ b/win8/metro_driver/chrome_app_view_ash.h
@@ -60,7 +60,7 @@ class ChromeAppViewAsh
// Returns S_OK on success.
static HRESULT Unsnap();
- void OnActivateDesktop(const base::FilePath& file_path);
+ void OnActivateDesktop(const base::FilePath& file_path, bool ash_exit);
void OnOpenURLOnDesktop(const base::FilePath& shortcut, const string16& url);
void OnSetCursor(HCURSOR cursor);
void OnDisplayFileOpenDialog(const string16& title,