summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer/util')
-rw-r--r--chrome/installer/util/html_dialog.h18
-rw-r--r--chrome/installer/util/html_dialog_impl.cc9
-rwxr-xr-xchrome/installer/util/util_constants.h3
3 files changed, 22 insertions, 8 deletions
diff --git a/chrome/installer/util/html_dialog.h b/chrome/installer/util/html_dialog.h
index 91ace2d..39b741d 100644
--- a/chrome/installer/util/html_dialog.h
+++ b/chrome/installer/util/html_dialog.h
@@ -59,16 +59,24 @@ class HTMLDialog {
HTMLDialog* CreateNativeHTMLDialog(const std::wstring& url);
// This class leverages HTMLDialog to create a dialog that is suitable
-// for a end-user-agreement modal dialog.
+// for a end-user-agreement modal dialog. The html shows a fairly standard
+// EULA form with the accept and cancel buttons and an optional check box
+// to opt-in for sending usage stats and crash reports.
class EulaHTMLDialog {
public:
- // |file| points to an html file on disk.
+ // |file| points to an html file on disk or to a resource via res:// spec.
explicit EulaHTMLDialog(const std::wstring& file);
~EulaHTMLDialog();
- // Shows the dialog and blocks for user input. The return value is true if
- // the user accepted and false otherwise.
- bool ShowModal();
+ enum Outcome {
+ REJECTED, // Declined EULA, mapped from HTML_DLG_ACCEPT (1).
+ ACCEPTED, // Accepted EULA no opt-in, from HTML_DLG_DECLINE (2).
+ ACCEPTED_OPT_IN, // Accepted EULA and opt-in, from HTML_DLG_EXTRA (6).
+ };
+
+ // Shows the dialog and blocks for user input. The return value is one of
+ // the |Outcome| values and any form of failure maps to REJECTED.
+ Outcome ShowModal();
private:
class Customizer : public HTMLDialog::CustomizationCallback {
diff --git a/chrome/installer/util/html_dialog_impl.cc b/chrome/installer/util/html_dialog_impl.cc
index 2bbf57a..a758d42 100644
--- a/chrome/installer/util/html_dialog_impl.cc
+++ b/chrome/installer/util/html_dialog_impl.cc
@@ -171,10 +171,15 @@ EulaHTMLDialog::~EulaHTMLDialog() {
delete dialog_;
}
-bool EulaHTMLDialog::ShowModal() {
+EulaHTMLDialog::Outcome EulaHTMLDialog::ShowModal() {
Customizer customizer;
HTMLDialog::DialogResult dr = dialog_->ShowModal(NULL, &customizer);
- return (HTMLDialog::HTML_DLG_ACCEPT == dr || HTMLDialog::HTML_DLG_EXTRA == dr);
+ if (HTMLDialog::HTML_DLG_ACCEPT == dr)
+ return EulaHTMLDialog::ACCEPTED;
+ else if (HTMLDialog::HTML_DLG_EXTRA == dr)
+ return EulaHTMLDialog::ACCEPTED_OPT_IN;
+ else
+ return EulaHTMLDialog::REJECTED;
}
} // namespace installer
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 4ee2af7..1c4e792 100755
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -35,7 +35,8 @@ enum InstallStatus {
RENAME_SUCCESSFUL, // Rename of new_chrome.exe to chrome.exe worked
RENAME_FAILED, // Rename of new_chrome.exe failed
EULA_REJECTED, // EULA dialog was not accepted by user.
- EULA_ACCEPTED // EULA dialog was accepted by user.
+ EULA_ACCEPTED, // EULA dialog was accepted by user.
+ EULA_ACCEPTED_OPT_IN // EULA accepted wtih the crash optin selected.
};
// These are distibution related install options specified through command