OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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.h" | 5 #include "chrome/browser/first_run.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 | 10 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 bool Upgrade::RelaunchChromeBrowser(const CommandLine& command_line) { | 304 bool Upgrade::RelaunchChromeBrowser(const CommandLine& command_line) { |
305 ::SetEnvironmentVariable(google_update::kEnvProductVersionKey, NULL); | 305 ::SetEnvironmentVariable(google_update::kEnvProductVersionKey, NULL); |
306 return base::LaunchApp(command_line.command_line_string(), | 306 return base::LaunchApp(command_line.command_line_string(), |
307 false, false, NULL); | 307 false, false, NULL); |
308 } | 308 } |
309 | 309 |
310 bool Upgrade::SwapNewChromeExeIfPresent() { | 310 bool Upgrade::SwapNewChromeExeIfPresent() { |
311 std::wstring new_chrome_exe; | 311 std::wstring new_chrome_exe; |
312 if (!GetNewerChromeFile(&new_chrome_exe)) | 312 if (!GetNewerChromeFile(&new_chrome_exe)) |
313 return false; | 313 return false; |
314 if (!file_util::PathExists(FilePath::FromWStringHack(new_chrome_exe))) | 314 if (!file_util::PathExists(new_chrome_exe)) |
315 return false; | 315 return false; |
316 std::wstring curr_chrome_exe; | 316 std::wstring curr_chrome_exe; |
317 if (!PathService::Get(base::FILE_EXE, &curr_chrome_exe)) | 317 if (!PathService::Get(base::FILE_EXE, &curr_chrome_exe)) |
318 return false; | 318 return false; |
319 | 319 |
320 // First try to rename exe by launching rename command ourselves. | 320 // First try to rename exe by launching rename command ourselves. |
321 bool user_install = InstallUtil::IsPerUserInstall(curr_chrome_exe.c_str()); | 321 bool user_install = InstallUtil::IsPerUserInstall(curr_chrome_exe.c_str()); |
322 HKEY reg_root = user_install ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; | 322 HKEY reg_root = user_install ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; |
323 BrowserDistribution *dist = BrowserDistribution::GetDistribution(); | 323 BrowserDistribution *dist = BrowserDistribution::GetDistribution(); |
324 RegKey key; | 324 RegKey key; |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 | 922 |
923 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog); | 923 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog); |
924 }; | 924 }; |
925 | 925 |
926 } // namespace | 926 } // namespace |
927 | 927 |
928 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { | 928 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { |
929 TryChromeDialog td(version); | 929 TryChromeDialog td(version); |
930 return td.ShowModal(); | 930 return td.ShowModal(); |
931 } | 931 } |
OLD | NEW |