Commit aec91930 authored by zturner@chromium.org's avatar zturner@chromium.org

Fix some non-aura specific code related to metro startup.

There was a legitimate bug here, but it only occurred on non-aura builds.
On aura builds, the code was still incorrect but by luck exhibited the
correct behavior.

The confusion about this behavior comes from the fact that prior to
r232828, we allowed Desktop and Metro instances of chrome to run 
simultaneously, depending on which shortcut you clicked.  As of r232828, 
all shortcuts lead to the same browser experience, and we store the 
"stickiness" in the registry and the launch experience is based entirely 
off of the value stored in the registry.

As a result, the code here which was incorrect, and which is fixed in this 
patch, only matters for non-Aura.


BUG=314034

Review URL: https://codereview.chromium.org/60823002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233527 0039d316-1c4b-4281-b951-d872f2087c98
parent cfe90f57
...@@ -112,6 +112,7 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, ...@@ -112,6 +112,7 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window,
if (!thread_id || !process_id) if (!thread_id || !process_id)
return NOTIFY_FAILED; return NOTIFY_FAILED;
#if !defined(USE_AURA)
if (base::win::IsMetroProcess()) { if (base::win::IsMetroProcess()) {
// Interesting corner case. We are launched as a metro process but we // Interesting corner case. We are launched as a metro process but we
// found another chrome running. Since metro enforces single instance then // found another chrome running. Since metro enforces single instance then
...@@ -140,10 +141,15 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, ...@@ -140,10 +141,15 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window,
if (base::win::GetVersion() >= base::win::VERSION_WIN8 && if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
base::OpenProcessHandleWithAccess( base::OpenProcessHandleWithAccess(
process_id, PROCESS_QUERY_INFORMATION, process_id, PROCESS_QUERY_INFORMATION,
process_handle.Receive()) && process_handle.Receive())) {
base::win::IsProcessImmersive(process_handle.Get())) { // Receive() causes the process handle to be set in the destructor of the
chrome::ActivateMetroChrome(); // temporary receiver object, which does not happen until after the if
// statement is complete. So IsProcessImmersive() should only be checked
// as part of a separate if statement.
if (base::win::IsProcessImmersive(process_handle.Get()))
chrome::ActivateMetroChrome();
} }
#endif
CommandLine command_line(*CommandLine::ForCurrentProcess()); CommandLine command_line(*CommandLine::ForCurrentProcess());
command_line.AppendSwitchASCII( command_line.AppendSwitchASCII(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment