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

Side by Side Diff: chrome/browser/first_run/first_run.cc

Issue 7250013: Prevent users from bypassing the EULA shown on first run by killing setup.exe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/first_run/first_run.h" 5 #include "chrome/browser/first_run/first_run.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // result determines if we continue or not. We wait here until the user 130 // result determines if we continue or not. We wait here until the user
131 // dismisses the dialog. 131 // dismisses the dialog.
132 132
133 // The actual eula text is in a resource in chrome. We extract it to 133 // The actual eula text is in a resource in chrome. We extract it to
134 // a text file so setup.exe can use it as an inner frame. 134 // a text file so setup.exe can use it as an inner frame.
135 FilePath inner_html; 135 FilePath inner_html;
136 if (WriteEULAtoTempFile(&inner_html)) { 136 if (WriteEULAtoTempFile(&inner_html)) {
137 int retcode = 0; 137 int retcode = 0;
138 if (!LaunchSetupWithParam(installer::switches::kShowEula, 138 if (!LaunchSetupWithParam(installer::switches::kShowEula,
139 inner_html.value(), &retcode) || 139 inner_html.value(), &retcode) ||
140 (retcode == installer::EULA_REJECTED)) { 140 (retcode != installer::EULA_ACCEPTED &&
141 retcode != installer::EULA_ACCEPTED_OPT_IN)) {
141 LOG(WARNING) << "EULA rejected. Fast exit."; 142 LOG(WARNING) << "EULA rejected. Fast exit.";
142 ::ExitProcess(1); 143 ::ExitProcess(1);
143 } 144 }
144 if (retcode == installer::EULA_ACCEPTED) { 145 if (retcode == installer::EULA_ACCEPTED) {
145 VLOG(1) << "EULA : no collection"; 146 VLOG(1) << "EULA : no collection";
146 GoogleUpdateSettings::SetCollectStatsConsent(false); 147 GoogleUpdateSettings::SetCollectStatsConsent(false);
147 } else if (retcode == installer::EULA_ACCEPTED_OPT_IN) { 148 } else if (retcode == installer::EULA_ACCEPTED_OPT_IN) {
148 VLOG(1) << "EULA : collection consent"; 149 VLOG(1) << "EULA : collection consent";
149 GoogleUpdateSettings::SetCollectStatsConsent(true); 150 GoogleUpdateSettings::SetCollectStatsConsent(true);
150 } 151 }
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 if (!observer->ended()) { 649 if (!observer->ended()) {
649 observer->set_should_quit_message_loop(); 650 observer->set_should_quit_message_loop();
650 MessageLoop::current()->Run(); 651 MessageLoop::current()->Run();
651 } 652 }
652 653
653 // Unfortunately there's no success/fail signal in ImporterHost. 654 // Unfortunately there's no success/fail signal in ImporterHost.
654 return true; 655 return true;
655 } 656 }
656 657
657 #endif // OS_POSIX 658 #endif // OS_POSIX
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698