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

Unified Diff: chrome/browser/chrome_process_finder_win.cc

Issue 60823002: Fix some non-aura specific code related to metro startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment explaining the reasoning for splitting compound if statement. Created 7 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698