| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file defines specific implementation of BrowserDistribution class for | 5 // This file defines specific implementation of BrowserDistribution class for |
| 6 // Google Chrome. | 6 // Google Chrome. |
| 7 | 7 |
| 8 #include "chrome/installer/util/google_chrome_distribution.h" | 8 #include "chrome/installer/util/google_chrome_distribution.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 product_guid()); | 496 product_guid()); |
| 497 } | 497 } |
| 498 | 498 |
| 499 // The functions below are not used by the 64-bit Windows binary - | 499 // The functions below are not used by the 64-bit Windows binary - |
| 500 // see the comment in google_chrome_distribution_dummy.cc | 500 // see the comment in google_chrome_distribution_dummy.cc |
| 501 #ifndef _WIN64 | 501 #ifndef _WIN64 |
| 502 // A helper function that writes to HKLM if the handle was passed through the | 502 // A helper function that writes to HKLM if the handle was passed through the |
| 503 // command line, but HKCU otherwise. |experiment_group| is the value to write | 503 // command line, but HKCU otherwise. |experiment_group| is the value to write |
| 504 // and |last_write| is used when writing to HKLM to determine whether to close | 504 // and |last_write| is used when writing to HKLM to determine whether to close |
| 505 // the handle when done. | 505 // the handle when done. |
| 506 void SetClient(std::wstring experiment_group, bool last_write) { | 506 void SetClient(const std::wstring& experiment_group, bool last_write) { |
| 507 static int reg_key_handle = -1; | 507 static int reg_key_handle = -1; |
| 508 if (reg_key_handle == -1) { | 508 if (reg_key_handle == -1) { |
| 509 // If a specific Toast Results key handle (presumably to our HKLM key) was | 509 // If a specific Toast Results key handle (presumably to our HKLM key) was |
| 510 // passed in to the command line (such as for system level installs), we use | 510 // passed in to the command line (such as for system level installs), we use |
| 511 // it. Otherwise, we write to the key under HKCU. | 511 // it. Otherwise, we write to the key under HKCU. |
| 512 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); | 512 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); |
| 513 if (cmd_line.HasSwitch(installer::switches::kToastResultsKey)) { | 513 if (cmd_line.HasSwitch(installer::switches::kToastResultsKey)) { |
| 514 // Get the handle to the key under HKLM. | 514 // Get the handle to the key under HKLM. |
| 515 base::StringToInt(cmd_line.GetSwitchValueASCII( | 515 base::StringToInt(cmd_line.GetSwitchValueASCII( |
| 516 installer::switches::kToastResultsKey).c_str(), | 516 installer::switches::kToastResultsKey).c_str(), |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 // we waited for chrome to exit so the uninstall would not detect chrome | 759 // we waited for chrome to exit so the uninstall would not detect chrome |
| 760 // running. | 760 // running. |
| 761 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( | 761 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( |
| 762 installer::switches::kSystemLevelToast); | 762 installer::switches::kSystemLevelToast); |
| 763 | 763 |
| 764 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, | 764 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, |
| 765 GetType())); | 765 GetType())); |
| 766 base::LaunchApp(cmd, false, false, NULL); | 766 base::LaunchApp(cmd, false, false, NULL); |
| 767 } | 767 } |
| 768 #endif | 768 #endif |
| OLD | NEW |