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

Side by Side Diff: chrome/browser/first_run/upgrade_util_win.cc

Issue 1419223006: win: Don't use delegate_execute to relaunch on Win10+ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/first_run/upgrade_util.h" 5 #include "chrome/browser/first_run/upgrade_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <psapi.h> 8 #include <psapi.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 NOTREACHED(); 154 NOTREACHED();
155 return false; 155 return false;
156 } 156 }
157 157
158 // Explicitly make sure to relaunch chrome.exe rather than old_chrome.exe. 158 // Explicitly make sure to relaunch chrome.exe rather than old_chrome.exe.
159 // This can happen when old_chrome.exe is launched by a user. 159 // This can happen when old_chrome.exe is launched by a user.
160 base::CommandLine chrome_exe_command_line = command_line; 160 base::CommandLine chrome_exe_command_line = command_line;
161 chrome_exe_command_line.SetProgram( 161 chrome_exe_command_line.SetProgram(
162 chrome_exe.DirName().Append(installer::kChromeExe)); 162 chrome_exe.DirName().Append(installer::kChromeExe));
163 163
164 if (base::win::GetVersion() < base::win::VERSION_WIN8 && 164 if (base::win::GetVersion() != base::win::VERSION_WIN8 &&
165 base::win::GetVersion() != base::win::VERSION_WIN8_1 &&
gab 2015/10/29 21:06:05 I tend to prefer version ranges to strict comparis
scottmg 2015/10/29 21:30:36 Done.
165 relaunch_mode != RELAUNCH_MODE_METRO && 166 relaunch_mode != RELAUNCH_MODE_METRO &&
166 relaunch_mode != RELAUNCH_MODE_DESKTOP) { 167 relaunch_mode != RELAUNCH_MODE_DESKTOP) {
gab 2015/10/29 21:06:05 Does the |relaunch_mode| really matter on non-Win8
scottmg 2015/10/29 21:30:36 I ... don't know. It seems like it shouldn't, I gu
167 return base::LaunchProcess(chrome_exe_command_line, 168 return base::LaunchProcess(chrome_exe_command_line,
168 base::LaunchOptions()).IsValid(); 169 base::LaunchOptions()).IsValid();
169 } 170 }
170 171
171 // On Windows 8 we always use the delegate_execute for re-launching chrome. 172 // On Windows 8 we always use the delegate_execute for re-launching chrome.
172 // On Windows 7 we use delegate_execute for re-launching chrome into Windows 173 // On Windows 7 we use delegate_execute for re-launching chrome into Windows
173 // ASH. 174 // ASH.
174 // 175 //
175 // Pass this Chrome's Start Menu shortcut path to the relauncher so it can re- 176 // Pass this Chrome's Start Menu shortcut path to the relauncher so it can re-
176 // activate chrome via ShellExecute which will wait until we exit. Since 177 // activate chrome via ShellExecute which will wait until we exit. Since
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 return false; 311 return false;
311 // At this point the chrome.exe has been swapped with the new one. 312 // At this point the chrome.exe has been swapped with the new one.
312 if (!RelaunchChromeBrowser(command_line)) { 313 if (!RelaunchChromeBrowser(command_line)) {
313 // The re-launch fails. Feel free to panic now. 314 // The re-launch fails. Feel free to panic now.
314 NOTREACHED(); 315 NOTREACHED();
315 } 316 }
316 return true; 317 return true;
317 } 318 }
318 319
319 } // namespace upgrade_util 320 } // namespace upgrade_util
OLDNEW
« 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