summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/eula/oem.css52
-rw-r--r--chrome/installer/setup/eula/oem.js18
-rw-r--r--chrome/installer/setup/eula/oem_en.html53
-rwxr-xr-xchrome/installer/setup/main.cc44
-rw-r--r--chrome/installer/setup/setup.rc26
5 files changed, 178 insertions, 15 deletions
diff --git a/chrome/installer/setup/eula/oem.css b/chrome/installer/setup/eula/oem.css
new file mode 100644
index 0000000..3d30301
--- /dev/null
+++ b/chrome/installer/setup/eula/oem.css
@@ -0,0 +1,52 @@
+html {
+ overflow:auto;
+}
+body, td {
+ overflow:auto;
+ margin:0px;
+ font-family:arial;
+ font-size:84%;
+}
+.header {
+ background-color:#d8dfea;
+ padding:10px 10px 10px 8px;
+}
+.icontext {
+ text-align:center;
+ font-family:tahoma;
+ font-size:11px;
+ padding:1px 0px 0px 2px;
+}
+.title {
+ font-size:115%;
+ font-weight:bold;
+}
+.desc {
+ display:block;
+ padding-top:5px;
+}
+.main {
+ margin:17px 13px 0px 14px;
+}
+.eula {
+ margin:5px 10px 0px 5px;
+}
+iframe {
+ border:1px solid #999999;
+}
+.footer {
+ position:absolute;
+ bottom:0px;
+ padding:5px 5px 5px 5px;
+}
+form {
+ margin:0px;
+ padding:0px;
+}
+.labelcell {
+ padding-top:2px;
+}
+.buttons {
+ margin:8px 5px 0px 5px;
+ text-align:right;
+} \ No newline at end of file
diff --git a/chrome/installer/setup/eula/oem.js b/chrome/installer/setup/eula/oem.js
new file mode 100644
index 0000000..2b0bcbd
--- /dev/null
+++ b/chrome/installer/setup/eula/oem.js
@@ -0,0 +1,18 @@
+function checkAccept(f) {
+ if (f.accept.checked) {
+ window.returnValue = 1;
+ } else {
+ window.returnValue = 2;
+ }
+ window.close();
+}
+
+function resize() {
+ var ifr = document.getElementById('ifr');
+ var footer = document.getElementById('footer');
+
+ ifr.height = footer.offsetTop - ifr.offsetTop;
+}
+
+window.onresize = resize;
+window.onload = resize; \ No newline at end of file
diff --git a/chrome/installer/setup/eula/oem_en.html b/chrome/installer/setup/eula/oem_en.html
new file mode 100644
index 0000000..d331d3a
--- /dev/null
+++ b/chrome/installer/setup/eula/oem_en.html
@@ -0,0 +1,53 @@
+<html>
+<head>
+<title>Google Chrome OEM EULA</title>
+<link rel="stylesheet" type="text/css" href="res://setup.exe/IDR_EULA_CSS.CSS" />
+<script type="text/javascript" src="res://setup.exe/IDR_EULA_JSC.JS"></script>
+</head>
+<body>
+<div class="header">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td valign="top" width="48" align="center">
+ <img class="icon" src="res://setup.exe/EULA/IDR_EULA_ICO.PNG" width="32" height="32" />
+ <div class="icontext">Google Chrome</div>
+ </td>
+ <td width="10">&nbsp;</td>
+ <td>
+ <span class="title">Surf the web with Google Chrome</span><br />
+ <span class="desc">Using the internet is faster, safer and easier
+ with Google Chrome, the web browser installed on your PC</span>
+ </td>
+ </tr>
+ </table>
+</div>
+<div class="main">
+ Accept the Google Chrome Terms of Service to start using Google Chrome:
+</div>
+<div class="eula">
+ <iframe id="ifr" src="res://setup.exe/IDR_TERMS_EN.HTML" width="100%" height="354" frameborder="0"></iframe>
+</div>
+<div id="footer" class="footer">
+ <form method="post" action="" onsubmit="checkAccept(this); return false;">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td valign="top">
+ <input type="checkbox" name="accept" id="accept" />&nbsp;
+ </td>
+ <td valign="top" class="labelcell">
+ <label for="accept"><b>Optional:</b> Help make Google Chrome
+ better by automatically sending usage statistics and crash reports
+ to Google.
+ <a href="http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=en">Learn more</a>
+ </label>
+ </td>
+ </tr>
+ </table>
+ <div class="buttons">
+ <input type="submit" name="submit" value="Accept and Run" />
+ <input type="submit" name="cancel" value="Cancel" />
+ </div>
+ </form>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc
index 8f57e06..925d49a 100755
--- a/chrome/installer/setup/main.cc
+++ b/chrome/installer/setup/main.cc
@@ -23,6 +23,7 @@
#include "chrome/installer/util/helper.h"
#include "chrome/installer/util/html_dialog.h"
#include "chrome/installer/util/install_util.h"
+#include "chrome/installer/util/l10n_string_util.h"
#include "chrome/installer/util/logging_installer.h"
#include "chrome/installer/util/lzma_util.h"
#include "chrome/installer/util/google_update_constants.h"
@@ -226,6 +227,10 @@ int GetInstallOptions(const CommandLine& cmd_line) {
if ((preferences & installer_util::MASTER_PROFILE_ERROR) == 0)
options |= installer_util::MASTER_PROFILE_VALID;
}
+ // While there is a --show-eula command line flag, we don't process
+ // it in this function because it requires special handling.
+ if (preferences & installer_util::MASTER_PROFILE_REQUIRE_EULA)
+ options |= installer_util::MASTER_PROFILE_REQUIRE_EULA;
}
if (preferences & installer_util::MASTER_PROFILE_CREATE_ALL_SHORTCUTS ||
@@ -247,7 +252,7 @@ int GetInstallOptions(const CommandLine& cmd_line) {
if (preferences & installer_util::MASTER_PROFILE_VERBOSE_LOGGING ||
cmd_line.HasSwitch(installer_util::switches::kVerboseLogging))
options |= installer_util::VERBOSE_LOGGING;
-
+
return options;
}
@@ -439,16 +444,19 @@ installer_util::InstallStatus UninstallChrome(const CommandLine& cmd_line,
*version, remove_all, force);
}
-// This function is temporary and meant to live while we get our eula dialogs
-// looking sharp. If the cmd line has --eula-test=path then the eula dialog
-// will be shown and no matter what the selection is the installer will exit.
-bool HandleEULADialog(const CommandLine& cmdline) {
- std:: wstring eula_path(cmdline.GetSwitchValue(L"eula-test"));
- if (eula_path.empty())
- return true;
+bool ShowEULADialog() {
+ LOG(INFO) << "About to show EULA";
+ std::wstring eula_path = installer_util::GetLocalizedEulaResource();
+ if (eula_path.empty()) {
+ LOG(ERROR) << "No EULA path available";
+ return false;
+ }
installer::EulaHTMLDialog dlg(eula_path);
- dlg.ShowModal();
- return false;
+ if (!dlg.ShowModal()) {
+ LOG(ERROR) << "EULA rejected or EULA failure";
+ return false;
+ }
+ return true;
}
} // namespace
@@ -467,9 +475,6 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
bool system_install = (options & installer_util::SYSTEM_LEVEL) != 0;
LOG(INFO) << "system install is " << system_install;
- if (!HandleEULADialog(parsed_command_line))
- return 0;
-
// Check to make sure current system is WinXP or later. If not, log
// error message and get out.
if (!InstallUtil::IsOSSupported()) {
@@ -489,6 +494,19 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
return installer_util::OS_ERROR;
}
+ // Check if we need to show the EULA. There are two cases:
+ // 1- If it is passed as a command line (--show-eula), then the dialog is
+ // shown and regardless of the outcome setup exits here.
+ // 2- If it is found in the installerdata file then the eula is shown
+ // and the installation proceeds if the user acepts.
+ if (parsed_command_line.HasSwitch(installer_util::switches::kShowEula)) {
+ return (ShowEULADialog() ?
+ installer_util::EULA_ACCEPTED : installer_util::EULA_REJECTED);
+ } else if (installer_util::MASTER_PROFILE_REQUIRE_EULA & options) {
+ if (!ShowEULADialog())
+ return installer_util::EULA_REJECTED;
+ }
+
// If --register-chrome-browser option is specified, register all
// Chrome protocol/file associations as well as register it as a valid
// browser for StarMenu->Internet shortcut. This option should only
diff --git a/chrome/installer/setup/setup.rc b/chrome/installer/setup/setup.rc
index f844d43..0f1b7c3 100644
--- a/chrome/installer/setup/setup.rc
+++ b/chrome/installer/setup/setup.rc
@@ -57,6 +57,30 @@ IDI_SETUP ICON "setup.ico"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
+#if defined(GOOGLE_CHROME_BUILD)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// EULA
+//
+IDR_EULA_ICO.PNG EULA "..\\..\\app\\theme\\google_chrome\\eula_icon.png"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// HTML
+//
+
+IDR_EULA_CSS.CSS HTML "eula\\oem.css"
+IDR_EULA_JSC.JS HTML "eula\\oem.js"
+
+IDR_OEMPG_EN.HTML HTML "eula\\oem_en.html"
+
+IDR_TERMS_EN.HTML HTML "..\\..\\app\\resources\\terms\\terms_en.html"
+IDR_TERMS_ES.HTML HTML "..\\..\\app\\resources\\terms\\terms_es.html"
+IDR_TERMS_FR.HTML HTML "..\\..\\app\\resources\\terms\\terms_fr.html"
+IDR_TERMS_BR.HTML HTML "..\\..\\app\\resources\\terms\\terms_pt-BR.html"
+
+#endif // defined(GOOGLE_CHROME_BUILD)
/////////////////////////////////////////////////////////////////////////////
//
@@ -64,7 +88,6 @@ IDI_SETUP ICON "setup.ico"
//
#include "installer_util_strings.rc"
-
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
@@ -72,7 +95,6 @@ IDI_SETUP ICON "setup.ico"
//
#include "setup_exe_version.rc"
-
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED