| Index: chrome/browser/first_run/first_run_win.cc
|
| diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
|
| index a66fd8c9631a935484c58bd87fd0b415980f8e13..31461fada071e8994744ad71e60b21974d4d079f 100644
|
| --- a/chrome/browser/first_run/first_run_win.cc
|
| +++ b/chrome/browser/first_run/first_run_win.cc
|
| @@ -171,6 +171,25 @@ bool LaunchSetupWithParam(const std::string& param,
|
| return (TRUE == ::GetExitCodeProcess(ph, reinterpret_cast<DWORD*>(ret_code)));
|
| }
|
|
|
| +// Returns true if the EULA is required but has not been accepted by this user.
|
| +// The EULA is considered having been accepted if the user has gotten past
|
| +// first run in the "other" environment (desktop or metro).
|
| +bool IsEulaNotAccepted(installer::MasterPreferences* install_prefs) {
|
| + bool value = false;
|
| + if (install_prefs->GetBool(installer::master_preferences::kRequireEula,
|
| + &value) && value) {
|
| + // Check for a first run sentinel in the alternate user data dir.
|
| + FilePath alt_user_data_dir;
|
| + if (!PathService::Get(chrome::DIR_ALT_USER_DATA, &alt_user_data_dir) ||
|
| + !file_util::DirectoryExists(alt_user_data_dir) ||
|
| + !file_util::PathExists(alt_user_data_dir.AppendASCII(
|
| + first_run::internal::kSentinelFile))) {
|
| + return true;
|
| + }
|
| + }
|
| + return false;
|
| +}
|
| +
|
| // Writes the EULA to a temporary file, returned in |*eula_path|, and returns
|
| // true if successful.
|
| bool WriteEULAtoTempFile(FilePath* eula_path) {
|
| @@ -188,9 +207,7 @@ bool WriteEULAtoTempFile(FilePath* eula_path) {
|
| }
|
|
|
| void ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) {
|
| - bool value = false;
|
| - if (install_prefs->GetBool(installer::master_preferences::kRequireEula,
|
| - &value) && value) {
|
| + if (IsEulaNotAccepted(install_prefs)) {
|
| // Show the post-installation EULA. This is done by setup.exe and the
|
| // result determines if we continue or not. We wait here until the user
|
| // dismisses the dialog.
|
|
|