Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Unified Diff: chrome/browser/first_run/first_run_win.cc

Issue 10539153: Do not show the EULA if it has already been accepted by the user in another user data dir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DIR_ALT_USER_DATA is windows only Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_paths.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | chrome/common/chrome_paths.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698