| 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 // 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 } | 422 } |
| 423 | 423 |
| 424 // Currently we only have one experiment: the inactive user toast. Which only | 424 // Currently we only have one experiment: the inactive user toast. Which only |
| 425 // applies for users doing upgrades and non-systemwide install. | 425 // applies for users doing upgrades and non-systemwide install. |
| 426 void GoogleChromeDistribution::LaunchUserExperiment( | 426 void GoogleChromeDistribution::LaunchUserExperiment( |
| 427 installer_util::InstallStatus status, const installer::Version& version, | 427 installer_util::InstallStatus status, const installer::Version& version, |
| 428 bool system_install) { | 428 bool system_install) { |
| 429 if ((installer_util::NEW_VERSION_UPDATED != status) || system_install) | 429 if ((installer_util::NEW_VERSION_UPDATED != status) || system_install) |
| 430 return; | 430 return; |
| 431 | 431 |
| 432 // If user has not opted-in for usage stats we don't do the experiments. | |
| 433 if (!GoogleUpdateSettings::GetCollectStatsConsent()) | |
| 434 return; | |
| 435 | |
| 436 // currently only two equal experiment groups. 90% get the welcome back url. | 432 // currently only two equal experiment groups. 90% get the welcome back url. |
| 437 int flavor = (base::RandDouble() > 0.1) ? 0 : 1; | 433 int flavor = (base::RandDouble() > 0.1) ? 0 : 1; |
| 438 | 434 |
| 439 std::wstring brand; | 435 std::wstring brand; |
| 440 if (GoogleUpdateSettings::GetBrand(&brand) && (brand == L"CHXX")) { | 436 if (GoogleUpdateSettings::GetBrand(&brand) && (brand == L"CHXX")) { |
| 441 // The user automatically qualifies for the experiment. | 437 // The user automatically qualifies for the experiment. |
| 442 LOG(INFO) << "Experiment qualification bypass"; | 438 LOG(INFO) << "Experiment qualification bypass"; |
| 443 } else { | 439 } else { |
| 444 // Time to verify the conditions for the experiment. | 440 // Time to verify the conditions for the experiment. |
| 445 std::wstring client_info; | 441 std::wstring client_info; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 }; | 500 }; |
| 505 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor)); | 501 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor)); |
| 506 if (outcome != kToastExpUninstallGroup) | 502 if (outcome != kToastExpUninstallGroup) |
| 507 return; | 503 return; |
| 508 // The user wants to uninstall. This is a best effort operation. Note that | 504 // The user wants to uninstall. This is a best effort operation. Note that |
| 509 // we waited for chrome to exit so the uninstall would not detect chrome | 505 // we waited for chrome to exit so the uninstall would not detect chrome |
| 510 // running. | 506 // running. |
| 511 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false), | 507 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false), |
| 512 false, false, NULL); | 508 false, false, NULL); |
| 513 } | 509 } |
| OLD | NEW |