Chromium Code Reviews| 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/chrome_browser_main_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 | 453 |
| 454 // Exit as we are not launching the browser. | 454 // Exit as we are not launching the browser. |
| 455 return content::RESULT_CODE_NORMAL_EXIT; | 455 return content::RESULT_CODE_NORMAL_EXIT; |
| 456 } | 456 } |
| 457 // We don't hide icons so we shouldn't do anything special to show them | 457 // We don't hide icons so we shouldn't do anything special to show them |
| 458 return chrome::RESULT_CODE_UNSUPPORTED_PARAM; | 458 return chrome::RESULT_CODE_UNSUPPORTED_PARAM; |
| 459 } | 459 } |
| 460 | 460 |
| 461 // static | 461 // static |
| 462 bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { | 462 bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { |
| 463 // TODO(tommi): Check if using the default distribution is always the right | 463 // TODO(tommi): Check if using the default distribution is always the right |
|
huangs
2017/01/09 09:09:10
Is this TODO now irrelevant?
grt (UTC plus 2)
2017/01/09 10:11:45
Yes!
| |
| 464 // thing to do. | 464 // thing to do. |
| 465 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 465 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 466 base::Version version; | 466 base::Version version; |
| 467 InstallUtil::GetChromeVersion(dist, true, &version); | 467 InstallUtil::GetChromeVersion(dist, true, &version); |
| 468 if (version.IsValid()) { | 468 if (version.IsValid()) { |
| 469 base::FilePath exe_path; | 469 base::FilePath exe_path; |
| 470 PathService::Get(base::DIR_EXE, &exe_path); | 470 PathService::Get(base::DIR_EXE, &exe_path); |
| 471 std::wstring exe = exe_path.value(); | 471 std::wstring exe = exe_path.value(); |
| 472 base::FilePath user_exe_path(installer::GetChromeInstallPath(false, dist)); | 472 base::FilePath user_exe_path(installer::GetChromeInstallPath(false, dist)); |
| 473 if (base::FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) { | 473 if (base::FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) { |
| 474 base::CommandLine uninstall_cmd( | 474 base::CommandLine uninstall_cmd( |
| 475 InstallUtil::GetChromeUninstallCmd(false, dist->GetType())); | 475 InstallUtil::GetChromeUninstallCmd(false)); |
| 476 if (!uninstall_cmd.GetProgram().empty()) { | 476 if (!uninstall_cmd.GetProgram().empty()) { |
| 477 uninstall_cmd.AppendSwitch(installer::switches::kSelfDestruct); | 477 uninstall_cmd.AppendSwitch(installer::switches::kSelfDestruct); |
| 478 uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); | 478 uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); |
| 479 uninstall_cmd.AppendSwitch( | 479 uninstall_cmd.AppendSwitch( |
| 480 installer::switches::kDoNotRemoveSharedItems); | 480 installer::switches::kDoNotRemoveSharedItems); |
| 481 | 481 |
| 482 // Trigger Active Setup for the system-level Chrome to make sure | 482 // Trigger Active Setup for the system-level Chrome to make sure |
| 483 // per-user shortcuts to the system-level Chrome are created. Skip this | 483 // per-user shortcuts to the system-level Chrome are created. Skip this |
| 484 // if the system-level Chrome will undergo first run anyway, as Active | 484 // if the system-level Chrome will undergo first run anyway, as Active |
| 485 // Setup is triggered on system-level Chrome's first run. | 485 // Setup is triggered on system-level Chrome's first run. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 if (resource_id) | 525 if (resource_id) |
| 526 return l10n_util::GetStringUTF16(resource_id); | 526 return l10n_util::GetStringUTF16(resource_id); |
| 527 return base::string16(); | 527 return base::string16(); |
| 528 } | 528 } |
| 529 | 529 |
| 530 // static | 530 // static |
| 531 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 531 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 532 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 532 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 533 installer::SetTranslationDelegate(&delegate); | 533 installer::SetTranslationDelegate(&delegate); |
| 534 } | 534 } |
| OLD | NEW |