Chromium Code Reviews| Index: chrome/browser/chrome_process_finder_win.cc |
| diff --git a/chrome/browser/chrome_process_finder_win.cc b/chrome/browser/chrome_process_finder_win.cc |
| index da0f7aeede3da76ee6c968e0d21df96517a75158..695907130af9399c1350e3e91949cb87b2a38f2f 100644 |
| --- a/chrome/browser/chrome_process_finder_win.cc |
| +++ b/chrome/browser/chrome_process_finder_win.cc |
| @@ -112,6 +112,7 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, |
| if (!thread_id || !process_id) |
| return NOTIFY_FAILED; |
| +#if !defined(USE_AURA) |
| if (base::win::IsMetroProcess()) { |
| // Interesting corner case. We are launched as a metro process but we |
| // found another chrome running. Since metro enforces single instance then |
| @@ -140,10 +141,15 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, |
| if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| base::OpenProcessHandleWithAccess( |
| process_id, PROCESS_QUERY_INFORMATION, |
| - process_handle.Receive()) && |
| - base::win::IsProcessImmersive(process_handle.Get())) { |
| - chrome::ActivateMetroChrome(); |
| + process_handle.Receive())) { |
| + // Receive() causes the process handle to be set in the destructor of the |
|
gab
2013/11/05 22:46:55
This very much surprised me as I expected the obje
gab
2013/11/05 22:50:12
this ^^^
|
| + // 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. |
|
gab
2013/11/05 22:46:55
This is pretty bad... a comment should probably be
|
| + if (base::win::IsProcessImmersive(process_handle.Get())) |
| + chrome::ActivateMetroChrome(); |
|
gab
2013/11/05 22:46:55
The use case this was meant to handle is that if y
|
| } |
| +#endif |
| CommandLine command_line(*CommandLine::ForCurrentProcess()); |
| command_line.AppendSwitchASCII( |