| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // 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 <atlbase.h> | 10 #include <atlbase.h> |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } | 432 } |
| 433 | 433 |
| 434 // Currently we only have one experiment: the inactive user toast. Which only | 434 // Currently we only have one experiment: the inactive user toast. Which only |
| 435 // applies for users doing upgrades and non-systemwide install. | 435 // applies for users doing upgrades and non-systemwide install. |
| 436 void GoogleChromeDistribution::LaunchUserExperiment( | 436 void GoogleChromeDistribution::LaunchUserExperiment( |
| 437 installer_util::InstallStatus status, const installer::Version& version, | 437 installer_util::InstallStatus status, const installer::Version& version, |
| 438 bool system_install) { | 438 bool system_install) { |
| 439 if ((installer_util::NEW_VERSION_UPDATED != status) || system_install) | 439 if ((installer_util::NEW_VERSION_UPDATED != status) || system_install) |
| 440 return; | 440 return; |
| 441 | 441 |
| 442 // If user has not opted-in for usage stats we don't do the experiments. | |
| 443 if (!GoogleUpdateSettings::GetCollectStatsConsent()) | |
| 444 return; | |
| 445 | |
| 446 // currently only two equal experiment groups. 90% get the welcome back url. | 442 // currently only two equal experiment groups. 90% get the welcome back url. |
| 447 int flavor = (base::RandDouble() > 0.1) ? 0 : 1; | 443 int flavor = (base::RandDouble() > 0.1) ? 0 : 1; |
| 448 | 444 |
| 449 std::wstring brand; | 445 std::wstring brand; |
| 450 if (GoogleUpdateSettings::GetBrand(&brand) && (brand == L"CHXX")) { | 446 if (GoogleUpdateSettings::GetBrand(&brand) && (brand == L"CHXX")) { |
| 451 // The user automatically qualifies for the experiment. | 447 // The user automatically qualifies for the experiment. |
| 452 LOG(INFO) << "Experiment qualification bypass"; | 448 LOG(INFO) << "Experiment qualification bypass"; |
| 453 } else { | 449 } else { |
| 454 // Time to verify the conditions for the experiment. | 450 // Time to verify the conditions for the experiment. |
| 455 std::wstring client_info; | 451 std::wstring client_info; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 }; | 511 }; |
| 516 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor)); | 512 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor)); |
| 517 if (outcome != kToastExpUninstallGroup) | 513 if (outcome != kToastExpUninstallGroup) |
| 518 return; | 514 return; |
| 519 // The user wants to uninstall. This is a best effort operation. Note that | 515 // The user wants to uninstall. This is a best effort operation. Note that |
| 520 // we waited for chrome to exit so the uninstall would not detect chrome | 516 // we waited for chrome to exit so the uninstall would not detect chrome |
| 521 // running. | 517 // running. |
| 522 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false), | 518 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false), |
| 523 false, false, NULL); | 519 false, false, NULL); |
| 524 } | 520 } |
| OLD | NEW |