| OLD | NEW |
| 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 <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool RelaunchChromeWithModeSwitch(const CommandLine& command_line) { | 169 bool RelaunchChromeWithModeSwitch(const CommandLine& command_line) { |
| 170 return RelaunchChromeHelper(command_line, true); | 170 return RelaunchChromeHelper(command_line, true); |
| 171 } | 171 } |
| 172 | 172 |
| 173 bool IsUpdatePendingRestart() { | 173 bool IsUpdatePendingRestart() { |
| 174 base::FilePath new_chrome_exe; | 174 base::FilePath new_chrome_exe; |
| 175 if (!GetNewerChromeFile(&new_chrome_exe)) | 175 if (!GetNewerChromeFile(&new_chrome_exe)) |
| 176 return false; | 176 return false; |
| 177 return file_util::PathExists(new_chrome_exe); | 177 return base::PathExists(new_chrome_exe); |
| 178 } | 178 } |
| 179 | 179 |
| 180 bool SwapNewChromeExeIfPresent() { | 180 bool SwapNewChromeExeIfPresent() { |
| 181 base::FilePath new_chrome_exe; | 181 base::FilePath new_chrome_exe; |
| 182 if (!GetNewerChromeFile(&new_chrome_exe)) | 182 if (!GetNewerChromeFile(&new_chrome_exe)) |
| 183 return false; | 183 return false; |
| 184 if (!file_util::PathExists(new_chrome_exe)) | 184 if (!base::PathExists(new_chrome_exe)) |
| 185 return false; | 185 return false; |
| 186 base::FilePath cur_chrome_exe; | 186 base::FilePath cur_chrome_exe; |
| 187 if (!PathService::Get(base::FILE_EXE, &cur_chrome_exe)) | 187 if (!PathService::Get(base::FILE_EXE, &cur_chrome_exe)) |
| 188 return false; | 188 return false; |
| 189 | 189 |
| 190 // Open up the registry key containing current version and rename information. | 190 // Open up the registry key containing current version and rename information. |
| 191 bool user_install = | 191 bool user_install = |
| 192 InstallUtil::IsPerUserInstall(cur_chrome_exe.value().c_str()); | 192 InstallUtil::IsPerUserInstall(cur_chrome_exe.value().c_str()); |
| 193 HKEY reg_root = user_install ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; | 193 HKEY reg_root = user_install ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; |
| 194 BrowserDistribution *dist = BrowserDistribution::GetDistribution(); | 194 BrowserDistribution *dist = BrowserDistribution::GetDistribution(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 return false; | 250 return false; |
| 251 // At this point the chrome.exe has been swapped with the new one. | 251 // At this point the chrome.exe has been swapped with the new one. |
| 252 if (!RelaunchChromeBrowser(command_line)) { | 252 if (!RelaunchChromeBrowser(command_line)) { |
| 253 // The re-launch fails. Feel free to panic now. | 253 // The re-launch fails. Feel free to panic now. |
| 254 NOTREACHED(); | 254 NOTREACHED(); |
| 255 } | 255 } |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace upgrade_util | 259 } // namespace upgrade_util |
| OLD | NEW |