summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/generated_resources.grd47
-rw-r--r--chrome/browser/browser_resources.grd4
-rw-r--r--chrome/browser/dom_ui/options/sync_options_handler.cc2
-rw-r--r--chrome/browser/sync/profile_sync_service.cc20
-rw-r--r--chrome/browser/sync/profile_sync_service.h11
-rw-r--r--chrome/browser/sync/resources/choose_datatypes.html381
-rw-r--r--chrome/browser/sync/resources/configure.html467
-rw-r--r--chrome/browser/sync/resources/passphrase.html131
-rw-r--r--chrome/browser/sync/resources/setting_up.html83
-rw-r--r--chrome/browser/sync/resources/setup_flow.html52
-rw-r--r--chrome/browser/sync/sync_setup_flow.cc222
-rw-r--r--chrome/browser/sync/sync_setup_flow.h40
-rw-r--r--chrome/browser/sync/sync_setup_wizard.cc243
-rw-r--r--chrome/browser/sync/sync_setup_wizard.h21
-rw-r--r--chrome/browser/sync/sync_setup_wizard_unittest.cc20
15 files changed, 1138 insertions, 606 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 9f629b6..80afe72 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -7937,7 +7937,15 @@ Keep your key file in a safe place. You will need it to create new versions of y
Synced to <ph name="USER_EMAIL_ADDRESS">$1<ex>foo@gmail.com</ex></ph>
</message>
- <!-- Customize Sync (data type choice) dialog strings -->
+ <!-- Customize Sync dialog, tab labels -->
+ <message name="IDS_SYNC_DATA_TYPES_TAB_NAME" desc="The title of the Data Types tab in the customize sync dialog.">
+ Data Types
+ </message>
+ <message name="IDS_SYNC_ENCRYPTION_TAB_NAME" desc="The title of the Encryption tab in the customize sync dialog.">
+ Encryption
+ </message>
+
+ <!-- Choose data types dialog strings -->
<message name="IDS_CUSTOMIZE_SYNC_WINDOW_TITLE" desc="The title of the Customize Sync dialog box.">
Customize Sync
</message>
@@ -7984,6 +7992,43 @@ Keep your key file in a safe place. You will need it to create new versions of y
Apps
</message>
+ <!-- Encryption tab of the configure sync dialog -->
+ <message name="IDS_SYNC_ENCRYPTION_INSTRUCTIONS" desc="Instructions for the encryption settings tab.">
+ <ph name="PRODUCT_NAME">$1<ex>Chrome</ex></ph> always encrypts your data when it's tramsmitted to Google. Additionally, passwords are stored encrypted on Google servers.
+ </message>
+ <message name="IDS_SYNC_ENCRYPT_ALL_LABEL" desc="Label for the checkbox that enables encryption of everything.">
+ Encrypt all my data
+ </message>
+ <message name="IDS_SYNC_PASSPHRASE_CHECKBOX_LABEL" desc="Label for the checkbox that enables a passphrase for sync.">
+ Use a sync passphrase to encrypt my data
+ </message>
+ <message name="IDS_SYNC_PASSPHRASE_WARNING" desc="Warning message about using a passphrase for sync.">
+ Once you start using a passphrase, you cannot remove the passphrase without clearing your sync data. The passphrase does not leave this computer, and if you lose this passphrase, you may not be able to sync this data on other computers.
+ </message>
+
+ <!-- Passphrase dialog strings -->
+ <message name="IDS_SYNC_NEW_PASSPHRASE_TITLE" desc="Title for the dialog where the user creates a new passphrase.">
+ Create a passphrase
+ </message>
+ <message name="IDS_SYNC_NEW_PASSPHRASE_BODY" desc="Instructions for the dialog where the user creates a new passphrase.">
+ Choose a passphrase to encrypt your sync data. This passphrase will not leave this computer, and if you lose it you may not be able to sync your data.
+ </message>
+ <message name="IDS_SYNC_ENTER_PASSPHRASE_TITLE" desc="Title for the dialog where the user enters the passphrase.">
+ Enter your passphrase
+ </message>
+ <message name="IDS_SYNC_ENTER_PASSPHRASE_BODY" desc="Instructions for the dialog where the user enters the passphrase.">
+ Your sync data has been encrypted using a passphrase. Please enter your passphrase to decrypt the data.
+ </message>
+ <message name="IDS_SYNC_GAIA_PASSPHRASE_TITLE" desc="Title for the dialog where the user enters their password as passphrase.">
+ Enter your Google account password
+ </message>
+ <message name="IDS_SYNC_GAIA_PASSPHRASE_BODY" desc="Instructions for the dialog where the user enters their password as passphrase.">
+ Your sync data has been encrypted. Please re-enter your password to decrypt the data.
+ </message>
+ <message name="IDS_SYNC_PASSPHRASE_LABEL" desc="Label for the passphrase field.">
+ Passphrase
+ </message>
+
<!-- Login dialog strings -->
<message name="IDS_SYNC_MY_BOOKMARKS_LABEL" desc="Title of the sync login dialog.">
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index cecfec6..d50a59f 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -53,7 +53,9 @@ without changes to the corresponding grd file. eter -->
<include name="IDR_SAFE_BROWSING_PHISHING_BLOCK" file="resources\safe_browsing_phishing_block.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SSL_ERROR_HTML" file="security\resources\ssl_error.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SSL_ROAD_BLOCK_HTML" file="security\resources\ssl_roadblock.html" flattenhtml="true" type="BINDATA" />
- <include name="IDR_SYNC_CHOOSE_DATATYPES_HTML" file="sync\resources\choose_datatypes.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_SYNC_CONFIGURE_HTML" file="sync\resources\configure.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_SYNC_PASSPHRASE_HTML" file="sync\resources\passphrase.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_SYNC_SETTING_UP_HTML" file="sync\resources\setting_up.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SYNC_SETUP_DONE_HTML" file="sync\resources\setup_done.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SYNC_SETUP_FLOW_HTML" file="sync\resources\setup_flow.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_REMOTING_SETUP_FLOW_HTML" file="remoting\resources\remoting_setup_flow.html" flattenhtml="true" type="BINDATA" />
diff --git a/chrome/browser/dom_ui/options/sync_options_handler.cc b/chrome/browser/dom_ui/options/sync_options_handler.cc
index a131cb5..7c19a59 100644
--- a/chrome/browser/dom_ui/options/sync_options_handler.cc
+++ b/chrome/browser/dom_ui/options/sync_options_handler.cc
@@ -62,7 +62,7 @@ void SyncOptionsHandler::Initialize() {
DCHECK(service);
DictionaryValue args;
- SyncSetupFlow::GetArgsForChooseDataTypes(service, &args);
+ SyncSetupFlow::GetArgsForConfigure(service, &args);
dom_ui_->CallJavascriptFunction(L"SyncOptions.setRegisteredDataTypes", args);
}
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 18b47cf..8593c6d 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -646,7 +646,7 @@ void ProfileSyncService::ShowChooseDataTypes(gfx::NativeWindow parent_window) {
return;
}
wizard_.SetParent(parent_window);
- wizard_.Step(SyncSetupWizard::CHOOSE_DATA_TYPES);
+ wizard_.Step(SyncSetupWizard::CONFIGURE);
}
SyncBackendHost::StatusSummary ProfileSyncService::QuerySyncStatusSummary() {
@@ -836,6 +836,15 @@ void ProfileSyncService::GetRegisteredDataTypes(
}
}
+bool ProfileSyncService::IsUsingSecondaryPassphrase() const {
+ return profile_->GetPrefs()->GetBoolean(prefs::kSyncUsingSecondaryPassphrase);
+}
+
+void ProfileSyncService::SetSecondaryPassphrase(const std::string& passphrase) {
+ SetPassphrase(passphrase);
+ profile_->GetPrefs()->SetBoolean(prefs::kSyncUsingSecondaryPassphrase, true);
+}
+
bool ProfileSyncService::IsCryptographerReady() const {
return backend_.get() && backend_->IsCryptographerReady();
}
@@ -931,9 +940,12 @@ void ProfileSyncService::Observe(NotificationType type,
break;
}
- // TODO(sync): Show the passphrase UI here.
- UpdateAuthErrorState(GoogleServiceAuthError(
- GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
+ if (SetupInProgress()) {
+ wizard_.Step(SyncSetupWizard::ENTER_PASSPHRASE);
+ } else {
+ UpdateAuthErrorState(GoogleServiceAuthError(
+ GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
+ }
break;
}
case NotificationType::SYNC_DATA_TYPES_UPDATED: {
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 8041ec0..e56aadc 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -100,7 +100,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
CANCEL_FROM_SIGNON_WITHOUT_AUTH = 10, // Cancelled before submitting
// username and password.
CANCEL_DURING_SIGNON = 11, // Cancelled after auth.
- CANCEL_FROM_CHOOSE_DATA_TYPES = 12, // Cancelled before choosing data
+ CANCEL_DURING_CONFIGURE = 12, // Cancelled before choosing data
// types and clicking OK.
// Events resulting in the stoppage of sync service.
STOP_FROM_OPTIONS = 20, // Sync was stopped from Wrench->Options.
@@ -220,7 +220,6 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
return wizard_.IsVisible();
}
virtual void ShowLoginDialog(gfx::NativeWindow parent_window);
-
void ShowChooseDataTypes(gfx::NativeWindow parent_window);
// Pretty-printed strings for a given StatusSummary.
@@ -267,7 +266,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
}
// The profile we are syncing for.
- Profile* profile() { return profile_; }
+ Profile* profile() const { return profile_; }
// Adds/removes an observer. ProfileSyncService does not take ownership of
// the observer.
@@ -329,6 +328,12 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// for sensitive data types.
virtual bool IsCryptographerReady() const;
+ // Returns true if a secondary passphrase is being used.
+ virtual bool IsUsingSecondaryPassphrase() const;
+
+ // Sets the secondary passphrase.
+ virtual void SetSecondaryPassphrase(const std::string& passphrase);
+
// Sets the Cryptographer's passphrase, or caches it until that is possible.
// This will check asynchronously whether the passphrase is valid and notify
// ProfileSyncServiceObservers via the NotificationService when the outcome
diff --git a/chrome/browser/sync/resources/choose_datatypes.html b/chrome/browser/sync/resources/choose_datatypes.html
deleted file mode 100644
index fd1a9bf..0000000
--- a/chrome/browser/sync/resources/choose_datatypes.html
+++ /dev/null
@@ -1,381 +0,0 @@
-<html i18n-values="dir:textdirection;">
-<head>
-<title></title>
-<style type="text/css">
-body {
- line-height: 1.5em;
- background: #FFFFFF;
- margin: 10px 15px;
- font-size: 11pt;
-}
-html[os='mac'] body {
- line-height: 1.5em;
- margin: 15px 20px;
- background: #FFFFFF;
-}
-form {
- -webkit-user-select: none;
-}
-.sync-header {
- font-size: 1.2em;
- font-weight: bold;
- margin-bottom: 10px;
-}
-.sync-select-customization {
- margin-top: 10px;
-}
-#chooseDataTypesRadio {
- vertical-align: top;
-}
-#chooseDataTypes > div {
- display: inline-block;
-}
-#chooseDataTypesBody {
- width: 90%;
- -webkit-margin-start: 3ex;
-}
-#chooseDataTypesBody > div {
- margin-top: 0px;
- -webkit-column-count: 2;
- -webkit-column-gap: 10px;
- column-count: 2;
- column-gap: 10px;
-}
-.sync-item-show {
- display: block;
- white-space: nowrap;
-}
-
-.sync-item-show > label {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- display: inline-block;
- width: 92%;
-}
-
-.sync-item-hide {
- display: none;
-}
-.sync-label-inactive {
- color: #9B9B9B;
-}
-.sync-label-active {
- color: #000000;
-}
-.sync-data-types {
- margin-left: 5px;
-}
-.sync-errors {
- margin-top: 5px;
-}
-.sync-error-show {
- display: block;
- width: 80%;
- margin-left: auto;
- margin-right: auto;
- text-align: center;
- padding: 1px 10px;
- background-color: #eeb939;
- -webkit-border-radius: 4px;
- font-weight: bold;
-}
-.sync-error-hide {
- display: none;
-}
-.sync-footer {
- position: fixed;
- right: 0px;
- bottom: 0px;
- margin-right: 10px;
- margin-bottom: 10px;
-}
-html[dir='rtl'] .sync-footer {
- text-align: left;
- left: 0px;
- bottom: 0px;
- margin-left: 20px;
-}
-#throb {
- background-image: url("../../../../app/resources/throbber.png");
- width: 16px;
- height: 16px;
- background-position: 0px;
- margin: -3px 10px;
- display: inline-block;
-}
-input[type='button'],
-input[type='submit'] {
- min-width: 87px;
- min-height: 26px;
-}
-html[os='mac'] input[type='button'],
-html[os='mac'] input[type='submit'] {
- font-size: 12pt;
-}
-
-</style>
-<script src="chrome://resources/js/cr.js"></script>
-<script>
-
- // Called once, when this html/js is loaded.
- function initializeChooseDataTypesDialog() {
- // Allow platform specific rules
- if (cr.isMac) {
- document.documentElement.setAttribute('os', 'mac');
- } else if (!cr.isWindows) {
- document.documentElement.setAttribute('os', 'linux');
- }
-
- setInterval(advanceThrobber, 30);
- var args = JSON.parse(chrome.dialogArguments);
- setChooseDataTypesCheckboxes(args);
- }
-
- function setCheckboxesAndErrors(args) {
- setChooseDataTypesCheckboxes(args);
- setErrorState(args);
- }
-
- // Can be called multiple times.
- function setChooseDataTypesCheckboxes(args) {
- setStateThrobbing(false);
-
- // If this frame is on top, the focus should be on it, so pressing enter
- // submits this form.
- if (args.iframeToShow == 'choose_data_types') {
- document.getElementById("okButton").focus();
- }
-
- document.getElementById("keepEverythingSyncedRadio").checked =
- args.keepEverythingSynced;
- document.getElementById("chooseDataTypesRadio").checked =
- !args.keepEverythingSynced;
- setDataTypeCheckboxesEnabled(!args.keepEverythingSynced);
-
- document.getElementById("bookmarksCheckbox").checked = args.syncBookmarks;
- document.getElementById("preferencesCheckbox").checked =
- args.syncPreferences;
- document.getElementById("themesCheckbox").checked = args.syncThemes;
-
- if (args.passwordsRegistered) {
- document.getElementById("passwordsCheckbox").checked = args.syncPasswords;
- document.getElementById("passwordsItem").className = "sync-item-show";
- } else {
- document.getElementById("passwordsItem").className = "sync-item-hide";
- }
- if (args.autofillRegistered) {
- document.getElementById("autofillCheckbox").checked = args.syncAutofill;
- document.getElementById("autofillItem").className = "sync-item-show";
- } else {
- document.getElementById("autofillItem").className = "sync-item-hide";
- }
- if (args.extensionsRegistered) {
- document.getElementById("extensionsCheckbox").checked =
- args.syncExtensions;
- document.getElementById("extensionsItem").className = "sync-item-show";
- } else {
- document.getElementById("extensionsItem").className = "sync-item-hide";
- }
- if (args.typedUrlsRegistered) {
- document.getElementById("typedUrlsCheckbox").checked = args.syncTypedUrls;
- document.getElementById("omniboxItem").className = "sync-item-show";
- } else {
- document.getElementById("omniboxItem").className = "sync-item-hide";
- }
- if (args.appsRegistered) {
- document.getElementById("appsCheckbox").checked =
- args.syncApps;
- document.getElementById("appsItem").className = "sync-item-show";
- } else {
- document.getElementById("appsItem").className = "sync-item-hide";
- }
- }
-
- function setErrorState(args) {
- if (!args.was_aborted)
- return;
- document.getElementById("aborted_text").className = "sync-error-show";
- document.getElementById("okButton").disabled = true;
- document.getElementById("keepEverythingSyncedRadio").disabled = true;
- document.getElementById("chooseDataTypesRadio").disabled = true;
- }
-
- function setDataTypeCheckboxesEnabled(enabled) {
- var checkboxes = document.getElementsByName("dataTypeCheckbox");
- var labels = document.getElementsByName("dataTypeLabel");
- for (var i = 0; i < checkboxes.length; i++) {
- checkboxes[i].disabled = !enabled;
- if (checkboxes[i].disabled) {
- labels[i].className = "sync-label-inactive";
- } else {
- labels[i].className = "sync-label-active";
- }
- }
- }
-
- function advanceThrobber() {
- var throbber = document.getElementById('throb');
- throbber.style.backgroundPositionX =
- ((parseInt(getComputedStyle(throbber).backgroundPositionX) - 16) %
- 576) + 'px';
- }
-
- function setStateThrobbing(isThrobbing) {
- var throbberContainer = document.getElementById('throbber_container');
- throbberContainer.style.visibility = isThrobbing ? "visible" : "hidden";
-
- var okButton = document.getElementById('okButton');
- okButton.disabled = isThrobbing || templateData["was_aborted"];
- okButton.value = isThrobbing ? templateData['settingup'] :
- templateData['ok'];
- }
-
- // Returns true if at least one data type is enabled and no data types are
- // checked. (If all data type checkboxes are disabled, it's because "keep
- // everything synced" is checked.)
- function noDataTypesChecked() {
- var checkboxes = document.getElementsByName("dataTypeCheckbox");
- var atLeastOneChecked = false;
- var atLeastOneEnabled = false;
- for (var i = 0; i < checkboxes.length; i++) {
- if (!checkboxes[i].disabled && checkboxes[i].style.display != 'none') {
- atLeastOneEnabled = true;
- if (checkboxes[i].checked) {
- atLeastOneChecked = true;
- }
- }
- }
- return atLeastOneEnabled && !atLeastOneChecked;
- }
-
- function sendChooseDataTypesAndClose() {
- // Trying to submit, so hide previous errors.
- document.getElementById("aborted_text").className = "sync-error-hide";
- document.getElementById("error_text").className = "sync-error-hide";
-
- if (noDataTypesChecked()) {
- document.getElementById("error_text").className = "sync-error-show";
- return;
- }
-
- setStateThrobbing(true);
-
- var f = document.getElementById("chooseDataTypesForm");
- var syncAll = f.keepEverythingSyncedRadio.checked;
- // These values need to be kept in sync with where they are read in
- // SyncSetupFlow::GetDataTypeChoiceData().
- var result = JSON.stringify({
- "keepEverythingSynced": syncAll,
- "syncBookmarks": syncAll || f.bookmarksCheckbox.checked,
- "syncPreferences": syncAll || f.preferencesCheckbox.checked,
- "syncThemes": syncAll || f.themesCheckbox.checked,
- "syncPasswords": syncAll || f.passwordsCheckbox.checked,
- "syncAutofill": syncAll || f.autofillCheckbox.checked,
- "syncExtensions": syncAll || f.extensionsCheckbox.checked,
- "syncTypedUrls": syncAll || f.typedUrlsCheckbox.checked,
- "syncApps": syncAll || f.appsCheckbox.checked
- });
- chrome.send("ChooseDataTypes", [result]);
- }
-
-</script>
-</head>
-<body i18n-values=".style.fontFamily:fontfamily"
- onload="initializeChooseDataTypesDialog();">
-<form id="chooseDataTypesForm"
- onSubmit="sendChooseDataTypesAndClose(); return false;">
-
- <div class="sync-header"
- i18n-content="choosedatatypesheader"></div>
- <div class="sync-choose_data_types_instructions"
- i18n-content="choosedatatypesinstructions"></div>
- <div class="sync-select-customization">
- <div class="sync-choice_radio">
- <input id="keepEverythingSyncedRadio" type="radio" name="syncChooseDataTypes"
- onclick="setDataTypeCheckboxesEnabled(false)">
- <label for="keepEverythingSyncedRadio" i18n-content="keepeverythingsynced">
- </label>
- </div>
- <div id="chooseDataTypes" class="sync-choice_radio">
- <input id="chooseDataTypesRadio" type="radio" name="syncChooseDataTypes"
- onclick="setDataTypeCheckboxesEnabled(true)">
- <label for="chooseDataTypesRadio" i18n-content="choosedatatypes" ></label>
- <div id="chooseDataTypesBody">
- <div>
- <!-- Apps -->
- <div class="sync-item-show" id="appsItem">
- <input id="appsCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="appsCheckboxLabel" name="dataTypeLabel"
- for="appsCheckbox" i18n-content="apps"
- i18n-values="title:apps"></label>
- </div>
- <!-- Autofill -->
- <div class="sync-item-show" id="autofillItem">
- <input id="autofillCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="autofillCheckboxLabel" name="dataTypeLabel"
- for="autofillCheckbox" i18n-content="autofill"
- i18n-values="title:autofill"></label>
- </div>
- <!-- Bookmarks -->
- <div class="sync-item-show" id="bookmarksItem">
- <input id="bookmarksCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="bookmarksCheckboxLabel" name="dataTypeLabel"
- for="bookmarksCheckbox" i18n-content="bookmarks"
- i18n-values="title:bookmarks"></label>
- </div>
- <!-- Extensions -->
- <div class="sync-item-show" id="extensionsItem">
- <input id="extensionsCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="extensionsCheckboxLabel" name="dataTypeLabel"
- for="extensionsCheckbox" i18n-content="extensions"
- i18n-values="title:extensions"></label>
- </div>
- <!-- Omnibox -->
- <div class="sync-item-show" id="omniboxItem">
- <input id="typedUrlsCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="typedUrlsCheckboxLabel" name="dataTypeLabel"
- for="typedUrlsCheckbox" i18n-content="typedurls"
- i18n-values="title:typedurls"></label>
- </div>
- <!-- Passwords -->
- <div class="sync-item-show" id="passwordsItem">
- <input id="passwordsCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="passwordsCheckboxLabel" name="dataTypeLabel"
- for="passwordsCheckbox" i18n-content="passwords"
- i18n-values="title:passwords"></label>
- </div>
- <!-- Preferences -->
- <div class="sync-item-show" id="preferencesItem">
- <input id="preferencesCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="preferencesCheckboxLabel" name="dataTypeLabel"
- for="preferencesCheckbox" i18n-content="preferences"
- i18n-values="title:preferences"></label>
- </div>
- <!-- Themes -->
- <div class="sync-item-show" id="themesItem">
- <input id="themesCheckbox" name="dataTypeCheckbox" type="checkbox">
- <label id="themesCheckboxLabel" name="dataTypeLabel" for="themesCheckbox"
- i18n-content="themes" i18n-values="title:themes"></label>
- </div>
- </div>
- </div>
- </div>
- <div class="sync-errors">
- <span id="error_text" i18n-content="synczerodatatypeserror"
- class="sync-error-hide"></span>
- <span id="aborted_text" i18n-content="setupabortederror"
- class="sync-error-hide"></span>
- </div>
- <div class="sync-footer">
- <span id="throbber_container" style="visibility:hidden">
- <span id="throb"></span>
- </span>
- <input id="okButton" type="submit" i18n-values="value:ok" />
- <input id="cancelButton" type="button" i18n-values="value:cancel"
- onclick='chrome.send("DialogClose", [""])' />
- </div>
-</div>
-</form>
-</body>
-</html>
diff --git a/chrome/browser/sync/resources/configure.html b/chrome/browser/sync/resources/configure.html
new file mode 100644
index 0000000..53eb154
--- /dev/null
+++ b/chrome/browser/sync/resources/configure.html
@@ -0,0 +1,467 @@
+<html i18n-values="dir:textdirection;">
+<head>
+<title></title>
+<style type="text/css">
+body {
+ line-height: 1.5em;
+ background: #FFFFFF;
+ font-size: 11pt;
+}
+html[os='mac'] body {
+ line-height: 1.5em;
+ background: #FFFFFF;
+}
+form {
+ -webkit-user-select: none;
+}
+.sync-header {
+ font-size: 1.2em;
+ font-weight: bold;
+ margin-bottom: 10px;
+}
+.sync-select-customization {
+ margin-top: 10px;
+}
+#chooseDataTypesRadio {
+ vertical-align: top;
+}
+#chooseDataTypes > div {
+ display: inline-block;
+}
+#chooseDataTypesBody {
+ width: 90%;
+ -webkit-margin-start: 3ex;
+}
+#chooseDataTypesBody > div {
+ margin-top: 0px;
+ -webkit-column-count: 2;
+ -webkit-column-gap: 10px;
+ column-count: 2;
+ column-gap: 10px;
+}
+
+.sync-config-tab-contents-inactive {
+ display: none;
+}
+.sync-config-tab-contents-active {
+ display: block;
+ margin: 10px 15px;
+}
+.sync-config-tabstrip {
+ border-bottom: 1px solid gray;
+ height: 25px;
+ margin-bottom: 10px;
+ padding-top: 10px;
+ background-color: #DDD;
+}
+.sync-config-tab-active {
+ background-color: white;
+ border-top: 1px solid gray;
+ border-left: 1px solid gray;
+ border-right: 1px solid gray;
+ border-top-left-radius: 5px 5px;
+ border-top-right-radius: 5px 5px;
+}
+
+.sync-config-tab-active,
+.sync-config-tab-inactive {
+ float: left;
+ height: 22px;
+ padding-top: 3px;
+ margin-left: 15px;
+ width: 100px;
+ text-align: center;
+}
+.sync-config-tab-active A,
+.sync-config-tab-inactive A,
+.sync-config-tab-active A:visited,
+.sync-config-tab-inactive A:visited,
+.sync-config-tab-active A:hover,
+.sync-config-tab-inactive A:hover {
+ color: black;
+ text-decoration: none;
+}
+
+#sync-encryption-instructions {
+ margin-bottom: 10px;
+ line-height: 1.8em;
+}
+
+#sync-passphrase-warning {
+ font-style: italic;
+ line-height: 1.8em;
+}
+
+#encryption-tab-contents > .sync_item_show {
+ margin-bottom: 5px;
+}
+
+.sync-item-show {
+ display: block;
+ white-space: nowrap;
+}
+
+.sync-item-show > label {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ display: inline-block;
+ width: 92%;
+}
+
+.sync-item-hide {
+ display: none;
+}
+.sync-label-inactive {
+ color: #9B9B9B;
+}
+.sync-label-active {
+ color: #000000;
+}
+.sync-data-types {
+ margin-left: 5px;
+}
+.sync-errors {
+ margin-top: 5px;
+}
+.sync-error-show {
+ display: block;
+ width: 80%;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+ padding: 1px 10px;
+ background-color: #eeb939;
+ -webkit-border-radius: 4px;
+ font-weight: bold;
+}
+.sync-error-hide {
+ display: none;
+}
+.sync-footer {
+ position: fixed;
+ right: 0px;
+ bottom: 0px;
+ margin-right: 10px;
+ margin-bottom: 10px;
+}
+html[dir='rtl'] .sync-footer {
+ text-align: left;
+ left: 0px;
+ bottom: 0px;
+ margin-left: 20px;
+}
+
+input[type='button'],
+input[type='submit'] {
+ min-width: 87px;
+ min-height: 26px;
+}
+html[os='mac'] input[type='button'],
+html[os='mac'] input[type='submit'] {
+ font-size: 12pt;
+}
+
+</style>
+<script src="chrome://resources/js/cr.js"></script>
+<script>
+ var currentTab;
+
+ // Called once, when this html/js is loaded.
+ function initializeConfigureDialog(args) {
+ // Allow platform specific rules
+ if (cr.isMac) {
+ document.documentElement.setAttribute('os', 'mac');
+ } else if (!cr.isWindows) {
+ document.documentElement.setAttribute('os', 'linux');
+ }
+
+ if (args) {
+ currentTab = args['initialTab'];
+ switchToTab(currentTab);
+ setCheckboxesAndErrors(args);
+ }
+ }
+
+ function setCheckboxesAndErrors(args) {
+ setChooseDataTypesCheckboxes(args);
+ setEncryptionCheckboxes(args);
+ setErrorState(args);
+ }
+
+ // Can be called multiple times.
+ function setChooseDataTypesCheckboxes(args) {
+ // If this frame is on top, the focus should be on it, so pressing enter
+ // submits this form.
+ if (args.iframeToShow == 'choose_data_types') {
+ document.getElementById("okButton").focus();
+ }
+
+ document.getElementById("keepEverythingSyncedRadio").checked =
+ args.keepEverythingSynced;
+ document.getElementById("chooseDataTypesRadio").checked =
+ !args.keepEverythingSynced;
+ setDataTypeCheckboxesEnabled(!args.keepEverythingSynced);
+
+ document.getElementById("bookmarksCheckbox").checked = args.syncBookmarks;
+ document.getElementById("preferencesCheckbox").checked =
+ args.syncPreferences;
+ document.getElementById("themesCheckbox").checked = args.syncThemes;
+
+ if (args.passwordsRegistered) {
+ document.getElementById("passwordsCheckbox").checked = args.syncPasswords;
+ document.getElementById("passwordsItem").className = "sync-item-show";
+ } else {
+ document.getElementById("passwordsItem").className = "sync-item-hide";
+ }
+ if (args.autofillRegistered) {
+ document.getElementById("autofillCheckbox").checked = args.syncAutofill;
+ document.getElementById("autofillItem").className = "sync-item-show";
+ } else {
+ document.getElementById("autofillItem").className = "sync-item-hide";
+ }
+ if (args.extensionsRegistered) {
+ document.getElementById("extensionsCheckbox").checked =
+ args.syncExtensions;
+ document.getElementById("extensionsItem").className = "sync-item-show";
+ } else {
+ document.getElementById("extensionsItem").className = "sync-item-hide";
+ }
+ if (args.typedUrlsRegistered) {
+ document.getElementById("typedUrlsCheckbox").checked = args.syncTypedUrls;
+ document.getElementById("omniboxItem").className = "sync-item-show";
+ } else {
+ document.getElementById("omniboxItem").className = "sync-item-hide";
+ }
+ if (args.appsRegistered) {
+ document.getElementById("appsCheckbox").checked =
+ args.syncApps;
+ document.getElementById("appsItem").className = "sync-item-show";
+ } else {
+ document.getElementById("appsItem").className = "sync-item-hide";
+ }
+ }
+
+ function setEncryptionCheckboxes(args) {
+ document.getElementById("usePassphraseCheckbox").checked =
+ args["usePassphrase"];
+
+ // The passphrase, once set, cannot be unset.
+ if (args["usePassphrase"]) {
+ document.getElementById("usePassphraseCheckbox").disabled = true;
+ }
+ }
+
+ function setErrorState(args) {
+ if (!args.was_aborted)
+ return;
+ document.getElementById("aborted_text").className = "sync-error-show";
+ document.getElementById("okButton").disabled = true;
+ document.getElementById("keepEverythingSyncedRadio").disabled = true;
+ document.getElementById("chooseDataTypesRadio").disabled = true;
+ }
+
+ function setDataTypeCheckboxesEnabled(enabled) {
+ var checkboxes = document.getElementsByName("dataTypeCheckbox");
+ var labels = document.getElementsByName("dataTypeLabel");
+ for (var i = 0; i < checkboxes.length; i++) {
+ checkboxes[i].disabled = !enabled;
+ if (checkboxes[i].disabled) {
+ labels[i].className = "sync-label-inactive";
+ } else {
+ labels[i].className = "sync-label-active";
+ }
+ }
+ }
+
+ // Returns true if at least one data type is enabled and no data types are
+ // checked. (If all data type checkboxes are disabled, it's because "keep
+ // everything synced" is checked.)
+ function noDataTypesChecked() {
+ var checkboxes = document.getElementsByName("dataTypeCheckbox");
+ var atLeastOneChecked = false;
+ var atLeastOneEnabled = false;
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (!checkboxes[i].disabled && checkboxes[i].style.display != 'none') {
+ atLeastOneEnabled = true;
+ if (checkboxes[i].checked) {
+ atLeastOneChecked = true;
+ }
+ }
+ }
+ return atLeastOneEnabled && !atLeastOneChecked;
+ }
+
+ function sendConfiguration() {
+ // Trying to submit, so hide previous errors.
+ document.getElementById("aborted_text").className = "sync-error-hide";
+ document.getElementById("error_text").className = "sync-error-hide";
+
+ if (noDataTypesChecked()) {
+ document.getElementById("error_text").className = "sync-error-show";
+ return;
+ }
+
+ var f = document.getElementById("chooseDataTypesForm");
+ var syncAll = f.keepEverythingSyncedRadio.checked;
+ // These values need to be kept in sync with where they are read in
+ // SyncSetupFlow::GetDataTypeChoiceData().
+ var result = JSON.stringify({
+ "keepEverythingSynced": syncAll,
+ "syncBookmarks": syncAll || f.bookmarksCheckbox.checked,
+ "syncPreferences": syncAll || f.preferencesCheckbox.checked,
+ "syncThemes": syncAll || f.themesCheckbox.checked,
+ "syncPasswords": syncAll || f.passwordsCheckbox.checked,
+ "syncAutofill": syncAll || f.autofillCheckbox.checked,
+ "syncExtensions": syncAll || f.extensionsCheckbox.checked,
+ "syncTypedUrls": syncAll || f.typedUrlsCheckbox.checked,
+ "syncApps": syncAll || f.appsCheckbox.checked,
+ "usePassphrase": document.getElementById("usePassphraseCheckbox").checked
+ });
+ chrome.send("Configure", [result]);
+ }
+
+ function switchToTab(newTab) {
+ if (currentTab) {
+ document.getElementById(currentTab + "-tab").className =
+ "sync-config-tab-inactive";
+ document.getElementById(currentTab + "-tab-contents").className =
+ "sync-config-tab-contents-inactive";
+ }
+
+ document.getElementById(newTab + "-tab").className =
+ "sync-config-tab-active";
+ document.getElementById(newTab + "-tab-contents").className =
+ "sync-config-tab-contents-active";
+
+ currentTab = newTab;
+ }
+
+</script>
+</head>
+<body i18n-values=".style.fontFamily:fontfamily"
+ onload="initializeConfigureDialog(JSON.parse(chrome.dialogArguments));">
+<form id="chooseDataTypesForm" onSubmit="sendConfiguration(); return false;">
+
+ <div class="sync-config-tabstrip">
+ <div id="data-type-tab" class="sync-config-tab-inactive">
+ <a href="#" onclick="switchToTab('data-type'); return false;"
+ i18n-content="dataTypes"></a>
+ </div>
+ <div id="encryption-tab" class="sync-config-tab-inactive">
+ <a href="#" onclick="switchToTab('encryption'); return false;"
+ i18n-content="encryption"></a>
+ </div>
+ </div>
+ <div id="data-type-tab-contents" class="sync-config-tab-contents-inactive">
+
+ <div class="sync-header"
+ i18n-content="choosedatatypesheader"></div>
+ <div class="sync-choose_data_types_instructions"
+ i18n-content="choosedatatypesinstructions"></div>
+ <div class="sync-select-customization">
+ <div class="sync-choice_radio">
+ <input id="keepEverythingSyncedRadio" type="radio"
+ name="syncChooseDataTypes"
+ onclick="setDataTypeCheckboxesEnabled(false)">
+ <label for="keepEverythingSyncedRadio"
+ i18n-content="keepeverythingsynced">
+ </label>
+ </div>
+ <div id="chooseDataTypes" class="sync-choice_radio">
+ <input id="chooseDataTypesRadio" type="radio" name="syncChooseDataTypes"
+ onclick="setDataTypeCheckboxesEnabled(true)">
+ <label for="chooseDataTypesRadio" i18n-content="choosedatatypes" ></label>
+ <div id="chooseDataTypesBody">
+ <div>
+ <!-- Apps -->
+ <div class="sync-item-show" id="appsItem">
+ <input id="appsCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="appsCheckboxLabel" name="dataTypeLabel"
+ for="appsCheckbox" i18n-content="apps"
+ i18n-values="title:apps"></label>
+ </div>
+ <!-- Autofill -->
+ <div class="sync-item-show" id="autofillItem">
+ <input id="autofillCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="autofillCheckboxLabel" name="dataTypeLabel"
+ for="autofillCheckbox" i18n-content="autofill"
+ i18n-values="title:autofill"></label>
+ </div>
+ <!-- Bookmarks -->
+ <div class="sync-item-show" id="bookmarksItem">
+ <input id="bookmarksCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="bookmarksCheckboxLabel" name="dataTypeLabel"
+ for="bookmarksCheckbox" i18n-content="bookmarks"
+ i18n-values="title:bookmarks"></label>
+ </div>
+ <!-- Extensions -->
+ <div class="sync-item-show" id="extensionsItem">
+ <input id="extensionsCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="extensionsCheckboxLabel" name="dataTypeLabel"
+ for="extensionsCheckbox" i18n-content="extensions"
+ i18n-values="title:extensions"></label>
+ </div>
+ <!-- Omnibox -->
+ <div class="sync-item-show" id="omniboxItem">
+ <input id="typedUrlsCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="typedUrlsCheckboxLabel" name="dataTypeLabel"
+ for="typedUrlsCheckbox" i18n-content="typedurls"
+ i18n-values="title:typedurls"></label>
+ </div>
+ <!-- Passwords -->
+ <div class="sync-item-show" id="passwordsItem">
+ <input id="passwordsCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="passwordsCheckboxLabel" name="dataTypeLabel"
+ for="passwordsCheckbox" i18n-content="passwords"
+ i18n-values="title:passwords"></label>
+ </div>
+ <!-- Preferences -->
+ <div class="sync-item-show" id="preferencesItem">
+ <input id="preferencesCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="preferencesCheckboxLabel" name="dataTypeLabel"
+ for="preferencesCheckbox" i18n-content="preferences"
+ i18n-values="title:preferences"></label>
+ </div>
+ <!-- Themes -->
+ <div class="sync-item-show" id="themesItem">
+ <input id="themesCheckbox" name="dataTypeCheckbox" type="checkbox">
+ <label id="themesCheckboxLabel" name="dataTypeLabel" for="themesCheckbox"
+ i18n-content="themes" i18n-values="title:themes"></label>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sync-errors">
+ <span id="error_text" i18n-content="synczerodatatypeserror"
+ class="sync-error-hide"></span>
+ <span id="aborted_text" i18n-content="abortederror"
+ class="sync-error-hide"></span>
+ </div>
+ </div>
+
+ </div>
+ <div id="encryption-tab-contents" class="sync-config-tab-contents-inactive">
+ <div id="sync-encryption-instructions"
+ i18n-content="encryptionInstructions"></div>
+
+ <div class="sync-item-show" id="usePassphrase">
+ <input id="usePassphraseCheckbox" name="usePassphraseCheckbox"
+ type="checkbox" />
+ <label id="usePassphraseLabel" name="usePassphraseLabel"
+ for="usePassphraseCheckbox" i18n-content="usePassphraseLabel">
+ </label>
+ </div>
+
+ <div id="sync-passphrase-warning" i18n-content="passphraseWarning">
+ </div>
+ </div>
+
+ <div class="sync-footer">
+ <input id="okButton" type="submit" i18n-values="value:ok" />
+ <input id="cancelButton" type="button" i18n-values="value:cancel"
+ onclick='chrome.send("DialogClose", [""])' />
+ </div>
+</form>
+</body>
+</html>
diff --git a/chrome/browser/sync/resources/passphrase.html b/chrome/browser/sync/resources/passphrase.html
new file mode 100644
index 0000000..653ead9
--- /dev/null
+++ b/chrome/browser/sync/resources/passphrase.html
@@ -0,0 +1,131 @@
+<html i18n-values="dir:textdirection;">
+<head>
+<title></title>
+<style type="text/css">
+body {
+ line-height: 1.5em;
+ background: #FFFFFF;
+ font-size: 11pt;
+}
+html[os='mac'] body {
+ line-height: 1.5em;
+ background: #FFFFFF;
+}
+form {
+ -webkit-user-select: none;
+}
+.sync-header {
+ font-size: 1.2em;
+ font-weight: bold;
+ margin-bottom: 10px;
+}
+.sync-instructions {
+ margin-top: 10px;
+}
+.sync-footer {
+ position: fixed;
+ right: 0px;
+ bottom: 0px;
+ margin-right: 10px;
+ margin-bottom: 10px;
+}
+html[dir='rtl'] .sync-footer {
+ text-align: left;
+ left: 0px;
+ bottom: 0px;
+ margin-left: 20px;
+}
+input[type='button'],
+input[type='submit'] {
+ min-width: 87px;
+ min-height: 26px;
+}
+html[os='mac'] input[type='button'],
+html[os='mac'] input[type='submit'] {
+ font-size: 12pt;
+}
+
+#new-passphrase,
+#enter-passphrase {
+ display: none;
+}
+
+</style>
+<script src="chrome://resources/js/cr.js"></script>
+<script>
+ var currentTab;
+
+ // Called once, when this html/js is loaded.
+ function setupPassphraseDialog(args) {
+ // Allow platform specific rules
+ if (cr.isMac) {
+ document.documentElement.setAttribute('os', 'mac');
+ } else if (!cr.isWindows) {
+ document.documentElement.setAttribute('os', 'linux');
+ }
+
+ if (args) {
+ currentMode = args['mode'];
+ switchToMode(currentMode);
+ }
+ }
+
+ function switchToMode(mode) {
+ if (mode == "new") {
+ document.getElementById("enter-passphrase").style.display = "none";
+ document.getElementById("gaia-passphrase").style.display = "none";
+ document.getElementById("new-passphrase").style.display = "block";
+ } else if (mode =="enter") {
+ document.getElementById("enter-passphrase").style.display = "block";
+ document.getElementById("gaia-passphrase").style.display = "none";
+ document.getElementById("new-passphrase").style.display = "none";
+ }
+ }
+
+ function sendPassphraseAndClose() {
+ var f = document.getElementById("passphraseForm");
+ var result = JSON.stringify({"passphrase": f.passphrase.value});
+ chrome.send("Passphrase", [result]);
+ }
+</script>
+</head>
+<body i18n-values=".style.fontFamily:fontfamily"
+ onload="setupPassphraseDialog();">
+<form id="passphraseForm"
+ onSubmit="sendPassphraseAndClose(); return false;">
+ <div id="new-passphrase">
+ <div class="sync-header" id="newTitle"
+ i18n-content="newPassphraseTitle"></div>
+ <div class="sync-instructions" id="newInstructions"
+ i18n-content="newPassphraseBody"></div>
+ </div>
+
+ <div id="enter-passphrase">
+ <div class="sync-header" id="enterTitle"
+ i18n-content="enterPassphraseTitle"></div>
+ <div class="sync-instructions" id="enterInstructions"
+ i18n-content="enterPassphraseBody"></div>
+ </div>
+
+ <div id="gaia-passphrase">
+ <div class="sync-header" id="gaiaTitle"
+ i18n-content="gaiaPassphraseTitle"></div>
+ <div class="sync-instructions" id="gaiaInstructions"
+ i18n-content="gaiaPassphraseBody"></div>
+ </div>
+
+ <div id="passphrase-input">
+ <label id="passphraseLabel" name="passphraseLabel"
+ for="passphrase" i18n-content="passphraseLabel">
+ </label>
+ <input id="passphrase" name="passphrase" type="password" />
+ </div>
+
+ <div class="sync-footer">
+ <input id="okButton" type="submit" i18n-values="value:ok" />
+ <input id="cancelButton" type="button" i18n-values="value:cancel"
+ onclick='chrome.send("DialogClose", [""])' />
+ </div>
+</form>
+</body>
+</html>
diff --git a/chrome/browser/sync/resources/setting_up.html b/chrome/browser/sync/resources/setting_up.html
new file mode 100644
index 0000000..61a9950
--- /dev/null
+++ b/chrome/browser/sync/resources/setting_up.html
@@ -0,0 +1,83 @@
+<html i18n-values="dir:textdirection;">
+<head>
+<title></title>
+<style type="text/css">
+body {
+ line-height: 1.5em;
+ background: #FFFFFF;
+ font-size: 11pt;
+}
+html[os='mac'] body {
+ line-height: 1.5em;
+ background: #FFFFFF;
+}
+form {
+ -webkit-user-select: none;
+}
+.sync-footer {
+ position: fixed;
+ right: 0px;
+ bottom: 0px;
+ margin-right: 10px;
+ margin-bottom: 10px;
+}
+html[dir='rtl'] .sync-footer {
+ text-align: left;
+ left: 0px;
+ bottom: 0px;
+ margin-left: 20px;
+}
+input[type='button'],
+input[type='submit'] {
+ min-width: 87px;
+ min-height: 26px;
+}
+html[os='mac'] input[type='button'],
+html[os='mac'] input[type='submit'] {
+ font-size: 12pt;
+}
+#throb {
+ background-image: url("../../../../app/resources/throbber.png");
+ width: 16px;
+ height: 16px;
+ background-position: 0px;
+ margin: -3px 10px;
+ display: inline-block;
+}
+#setting-up {
+ margin: 100px;
+ text-align: center;
+}
+#setting_up_label {
+ margin: 15px;
+ font-weight: bold;
+ font-size: 125%;
+}
+
+</style>
+<script src="chrome://resources/js/cr.js"></script>
+<script>
+ function advanceThrobber() {
+ var throbber = document.getElementById('throb');
+ throbber.style.backgroundPositionX =
+ ((parseInt(getComputedStyle(throbber).backgroundPositionX) - 16) %
+ 576) + 'px';
+ }
+ setInterval(advanceThrobber, 30);
+</script>
+</head>
+<body i18n-values=".style.fontFamily:fontfamily">
+<form id="settingUpForm" onSubmit="return false;">
+ <div id="setting_up>"
+ <span id="throbber_container">
+ <span id="throb"></span>
+ </span>
+ <div id="setting_up_label" i18n-content="settingup"></div>
+ </div>
+ <div class="sync-footer">
+ <input id="cancelButton" type="button" i18n-values="value:cancel"
+ onclick='chrome.send("DialogClose", [""])' />
+ </div>
+</form>
+</body>
+</html>
diff --git a/chrome/browser/sync/resources/setup_flow.html b/chrome/browser/sync/resources/setup_flow.html
index c45cf24..a3de363 100644
--- a/chrome/browser/sync/resources/setup_flow.html
+++ b/chrome/browser/sync/resources/setup_flow.html
@@ -2,34 +2,30 @@
<head>
<title></title>
<script type="text/javascript">
-
- // Called once, when this html/js is loaded.
- function showTheRightIframe() {
- hideAllPages();
- var args = JSON.parse(chrome.dialogArguments);
- document.getElementById(args.iframeToShow).style.display = 'block';
- document.getElementById(args.iframeToShow).tabIndex = 0;
- }
-
function hideAllPages() {
- document.getElementById('login').style.display = 'none';
- document.getElementById('login').tabIndex = -1;
- document.getElementById('choose_data_types').style.display = 'none';
- document.getElementById('choose_data_types').tabIndex = -1;
- document.getElementById('done').style.display = 'none';
- document.getElementById('done').tabIndex = -1;
- }
+ var pages = ['login', 'configure', 'passphrase', 'settingup', 'done'];
+ for (var i = 0; i < pages.length; ++i) {
+ document.getElementById(pages[i]).style.display = 'none';
+ document.getElementById(pages[i]).tabIndex = -1;
+ }
+ }
- function showChooseDataTypes() {
+ function showPage(page) {
hideAllPages();
- document.getElementById('choose_data_types').style.display = 'block';
- document.getElementById('choose_data_types').tabIndex = 0;
+ document.getElementById(page).style.display = 'block';
+ document.getElementById(page).tabIndex = 0;
}
- function showSetupDone() {
- hideAllPages();
- document.getElementById('done').style.display = 'block';
- document.getElementById('done').tabIndex = 0;
+ function showGaiaLoginIframe() { showPage('login'); }
+ function showConfigure() { showPage('configure'); }
+ function showPassphrase() { showPage('passphrase'); }
+ function showSettingUp() { showPage('settingup'); }
+ function showSetupDone() { showPage('done'); }
+
+ // Called once, when this html/js is loaded.
+ function showTheRightIframe() {
+ var args = JSON.parse(chrome.dialogArguments);
+ showPage(args.iframeToShow);
}
</script>
</head>
@@ -37,8 +33,14 @@
<iframe id="login" frameborder="0" width="100%" scrolling="no" height="100%"
src="chrome://syncresources/gaialogin" style="display:none"
tabindex="-1"></iframe>
- <iframe id="choose_data_types" frameborder="0" width="100%" scrolling="no"
- height="100%" src="chrome://syncresources/choosedatatypes"
+ <iframe id="configure" frameborder="0" width="100%" scrolling="no"
+ height="100%" src="chrome://syncresources/configure"
+ style="display:none" tabindex="-1"></iframe>
+ <iframe id="passphrase" frameborder="0" width="100%" scrolling="no"
+ height="100%" src="chrome://syncresources/passphrase"
+ style="display:none" tabindex="-1"></iframe>
+ <iframe id="settingup" frameborder="0" width="100%" scrolling="no"
+ height="100%" src="chrome://syncresources/settingup"
style="display:none" tabindex="-1"></iframe>
<iframe id="done" frameborder="0" width="100%" scrolling="no" height="100%"
src="chrome://syncresources/setupdone" style="display:none"
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index 594b0e0..0f22e8c 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/pref_names.h"
@@ -33,14 +32,18 @@
// XPath expression for finding specific iframes.
static const wchar_t* kLoginIFrameXPath = L"//iframe[@id='login']";
static const wchar_t* kChooseDataTypesIFrameXPath =
- L"//iframe[@id='choose_data_types']";
+ L"//iframe[@id='configure']";
+static const wchar_t* kPassphraseIFrameXPath =
+ L"//iframe[@id='passphrase']";
static const wchar_t* kDoneIframeXPath = L"//iframe[@id='done']";
void FlowHandler::RegisterMessages() {
dom_ui_->RegisterMessageCallback("SubmitAuth",
NewCallback(this, &FlowHandler::HandleSubmitAuth));
- dom_ui_->RegisterMessageCallback("ChooseDataTypes",
- NewCallback(this, &FlowHandler::HandleChooseDataTypes));
+ dom_ui_->RegisterMessageCallback("Configure",
+ NewCallback(this, &FlowHandler::HandleConfigure));
+ dom_ui_->RegisterMessageCallback("Passphrase",
+ NewCallback(this, &FlowHandler::HandlePassphraseEntry));
}
static bool GetAuthData(const std::string& json,
@@ -62,14 +65,23 @@ static bool GetAuthData(const std::string& json,
return true;
}
-static bool GetDataTypeChoiceData(const std::string& json,
- bool* sync_everything, syncable::ModelTypeSet* data_types) {
+static bool GetPassphrase(const std::string& json, std::string* passphrase) {
scoped_ptr<Value> parsed_value(base::JSONReader::Read(json, false));
if (!parsed_value.get() || !parsed_value->IsType(Value::TYPE_DICTIONARY))
return false;
DictionaryValue* result = static_cast<DictionaryValue*>(parsed_value.get());
- if (!result->GetBoolean("keepEverythingSynced", sync_everything))
+ return result->GetString("passphrase", passphrase);
+}
+
+static bool GetConfiguration(const std::string& json,
+ SyncConfiguration* config) {
+ scoped_ptr<Value> parsed_value(base::JSONReader::Read(json, false));
+ if (!parsed_value.get() || !parsed_value->IsType(Value::TYPE_DICTIONARY))
+ return false;
+
+ DictionaryValue* result = static_cast<DictionaryValue*>(parsed_value.get());
+ if (!result->GetBoolean("keepEverythingSynced", &config->sync_everything))
return false;
// These values need to be kept in sync with where they are written in
@@ -78,49 +90,53 @@ static bool GetDataTypeChoiceData(const std::string& json,
if (!result->GetBoolean("syncBookmarks", &sync_bookmarks))
return false;
if (sync_bookmarks)
- data_types->insert(syncable::BOOKMARKS);
+ config->data_types.insert(syncable::BOOKMARKS);
bool sync_preferences;
if (!result->GetBoolean("syncPreferences", &sync_preferences))
return false;
if (sync_preferences)
- data_types->insert(syncable::PREFERENCES);
+ config->data_types.insert(syncable::PREFERENCES);
bool sync_themes;
if (!result->GetBoolean("syncThemes", &sync_themes))
return false;
if (sync_themes)
- data_types->insert(syncable::THEMES);
+ config->data_types.insert(syncable::THEMES);
bool sync_passwords;
if (!result->GetBoolean("syncPasswords", &sync_passwords))
return false;
if (sync_passwords)
- data_types->insert(syncable::PASSWORDS);
+ config->data_types.insert(syncable::PASSWORDS);
bool sync_autofill;
if (!result->GetBoolean("syncAutofill", &sync_autofill))
return false;
if (sync_autofill)
- data_types->insert(syncable::AUTOFILL);
+ config->data_types.insert(syncable::AUTOFILL);
bool sync_extensions;
if (!result->GetBoolean("syncExtensions", &sync_extensions))
return false;
if (sync_extensions)
- data_types->insert(syncable::EXTENSIONS);
+ config->data_types.insert(syncable::EXTENSIONS);
bool sync_typed_urls;
if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls))
return false;
if (sync_typed_urls)
- data_types->insert(syncable::TYPED_URLS);
+ config->data_types.insert(syncable::TYPED_URLS);
bool sync_apps;
if (!result->GetBoolean("syncApps", &sync_apps))
return false;
if (sync_apps)
- data_types->insert(syncable::APPS);
+ config->data_types.insert(syncable::APPS);
+
+ // Encyption settings.
+ if (!result->GetBoolean("usePassphrase", &config->use_secondary_passphrase))
+ return false;
return true;
}
@@ -142,14 +158,14 @@ void FlowHandler::HandleSubmitAuth(const ListValue* args) {
flow_->OnUserSubmittedAuth(username, password, captcha, access_code);
}
-void FlowHandler::HandleChooseDataTypes(const ListValue* args) {
+void FlowHandler::HandleConfigure(const ListValue* args) {
std::string json(dom_ui_util::GetJsonResponseFromFirstArgumentInList(args));
- bool sync_everything;
- syncable::ModelTypeSet chosen_types;
+ SyncConfiguration configuration;
+
if (json.empty())
return;
- if (!GetDataTypeChoiceData(json, &sync_everything, &chosen_types)) {
+ if (!GetConfiguration(json, &configuration)) {
// The page sent us something that we didn't understand.
// This probably indicates a programming error.
NOTREACHED();
@@ -157,11 +173,28 @@ void FlowHandler::HandleChooseDataTypes(const ListValue* args) {
}
DCHECK(flow_);
- flow_->OnUserChoseDataTypes(sync_everything, chosen_types);
+ flow_->OnUserConfigured(configuration);
return;
}
+void FlowHandler::HandlePassphraseEntry(const ListValue* args) {
+ std::string json(dom_ui_util::GetJsonResponseFromFirstArgumentInList(args));
+
+ if (json.empty())
+ return;
+
+ std::string passphrase;
+ if (!GetPassphrase(json, &passphrase)) {
+ // Couldn't understand what the page sent. Indicates a programming error.
+ NOTREACHED();
+ return;
+ }
+
+ DCHECK(flow_);
+ flow_->OnPassphraseEntry(passphrase);
+}
+
// Called by SyncSetupFlow::Advance.
void FlowHandler::ShowGaiaLogin(const DictionaryValue& args) {
// Whenever you start a wizard, you pass in an arg so it starts on the right
@@ -191,20 +224,36 @@ void FlowHandler::ShowGaiaSuccessAndSettingUp() {
}
// Called by SyncSetupFlow::Advance.
-void FlowHandler::ShowChooseDataTypes(const DictionaryValue& args) {
- // If you're starting the wizard at the Choose Data Types screen (i.e. from
+void FlowHandler::ShowConfigure(const DictionaryValue& args) {
+ // If you're starting the wizard at the configure screen (i.e. from
// "Customize Sync"), this will be redundant. However, if you're coming from
// another wizard state, this will make sure Choose Data Types is on top.
if (dom_ui_)
- dom_ui_->CallJavascriptFunction(L"showChooseDataTypes");
+ dom_ui_->CallJavascriptFunction(L"showConfigure");
std::string json;
base::JSONWriter::Write(&args, false, &json);
- std::wstring javascript = std::wstring(L"setCheckboxesAndErrors") +
+ std::wstring javascript = std::wstring(L"initializeConfigureDialog") +
L"(" + UTF8ToWide(json) + L");";
ExecuteJavascriptInIFrame(kChooseDataTypesIFrameXPath, javascript);
}
+void FlowHandler::ShowPassphraseEntry(const DictionaryValue& args) {
+ if (dom_ui_)
+ dom_ui_->CallJavascriptFunction(L"showPassphrase");
+
+ std::string json;
+ base::JSONWriter::Write(&args, false, &json);
+ std::wstring script = std::wstring(L"setupPassphraseDialog") +
+ L"(" + UTF8ToWide(json) + L");";
+ ExecuteJavascriptInIFrame(kPassphraseIFrameXPath, script);
+}
+
+void FlowHandler::ShowSettingUp() {
+ if (dom_ui_)
+ dom_ui_->CallJavascriptFunction(L"showSettingUp");
+}
+
void FlowHandler::ShowSetupDone(const std::wstring& user) {
StringValue synced_to_string(l10n_util::GetStringFUTF8(
IDS_SYNC_NTP_SYNCED_TO, WideToUTF16Hack(user)));
@@ -248,6 +297,7 @@ SyncSetupFlow::SyncSetupFlow(SyncSetupWizard::State start_state,
login_start_time_(base::TimeTicks::Now()),
flow_handler_(new FlowHandler()),
owns_flow_handler_(true),
+ configuration_pending_(false),
service_(service),
html_dialog_window_(NULL) {
flow_handler_->set_flow(this);
@@ -305,9 +355,11 @@ void SyncSetupFlow::OnDialogClosed(const std::string& json_retval) {
ProfileSyncService::SyncEvent(
ProfileSyncService::CANCEL_DURING_SIGNON);
break;
- case SyncSetupWizard::CHOOSE_DATA_TYPES:
+ case SyncSetupWizard::CONFIGURE:
+ case SyncSetupWizard::ENTER_PASSPHRASE:
+ case SyncSetupWizard::SETTING_UP:
ProfileSyncService::SyncEvent(
- ProfileSyncService::CANCEL_FROM_CHOOSE_DATA_TYPES);
+ ProfileSyncService::CANCEL_DURING_CONFIGURE);
break;
case SyncSetupWizard::DONE_FIRST_TIME:
case SyncSetupWizard::DONE:
@@ -344,9 +396,13 @@ void SyncSetupFlow::GetArgsForGaiaLogin(const ProfileSyncService* service,
}
// static
-void SyncSetupFlow::GetArgsForChooseDataTypes(ProfileSyncService* service,
- DictionaryValue* args) {
- args->SetString("iframeToShow", "choose_data_types");
+void SyncSetupFlow::GetArgsForConfigure(ProfileSyncService* service,
+ DictionaryValue* args) {
+ args->SetString("iframeToShow", "configure");
+
+ // By default start on the data types tab.
+ args->SetString("initialTab", "data-type");
+
args->SetBoolean("keepEverythingSynced",
service->profile()->GetPrefs()->GetBoolean(prefs::kKeepEverythingSynced));
@@ -384,6 +440,9 @@ void SyncSetupFlow::GetArgsForChooseDataTypes(ProfileSyncService* service,
service->profile()->GetPrefs()->GetBoolean(prefs::kSyncTypedUrls));
args->SetBoolean("syncApps",
service->profile()->GetPrefs()->GetBoolean(prefs::kSyncApps));
+
+ // Load the parameters for the encryption tab.
+ args->SetBoolean("usePassphrase", service->IsUsingSecondaryPassphrase());
}
void SyncSetupFlow::GetDOMMessageHandlers(
@@ -394,6 +453,7 @@ void SyncSetupFlow::GetDOMMessageHandlers(
owns_flow_handler_ = false;
}
+// Returns true if the flow should advance to |state| based on |current_state_|.
bool SyncSetupFlow::ShouldAdvance(SyncSetupWizard::State state) {
switch (state) {
case SyncSetupWizard::GAIA_LOGIN:
@@ -401,15 +461,20 @@ bool SyncSetupFlow::ShouldAdvance(SyncSetupWizard::State state) {
current_state_ == SyncSetupWizard::GAIA_LOGIN;
case SyncSetupWizard::GAIA_SUCCESS:
return current_state_ == SyncSetupWizard::GAIA_LOGIN;
- case SyncSetupWizard::CHOOSE_DATA_TYPES:
+ case SyncSetupWizard::CONFIGURE:
return current_state_ == SyncSetupWizard::GAIA_SUCCESS;
+ case SyncSetupWizard::CREATE_PASSPHRASE:
+ return current_state_ == SyncSetupWizard::CONFIGURE;
case SyncSetupWizard::SETUP_ABORTED_BY_PENDING_CLEAR:
- return current_state_ == SyncSetupWizard::CHOOSE_DATA_TYPES;
+ return current_state_ == SyncSetupWizard::CONFIGURE;
+ case SyncSetupWizard::SETTING_UP:
+ return current_state_ == SyncSetupWizard::CONFIGURE ||
+ current_state_ == SyncSetupWizard::CREATE_PASSPHRASE;
case SyncSetupWizard::FATAL_ERROR:
return true; // You can always hit the panic button.
case SyncSetupWizard::DONE_FIRST_TIME:
case SyncSetupWizard::DONE:
- return current_state_ == SyncSetupWizard::CHOOSE_DATA_TYPES;
+ return current_state_ == SyncSetupWizard::SETTING_UP;
default:
NOTREACHED() << "Unhandled State: " << state;
return false;
@@ -417,8 +482,11 @@ bool SyncSetupFlow::ShouldAdvance(SyncSetupWizard::State state) {
}
void SyncSetupFlow::Advance(SyncSetupWizard::State advance_state) {
- if (!ShouldAdvance(advance_state))
+ if (!ShouldAdvance(advance_state)) {
+ LOG(WARNING) << "Invalid state change from "
+ << current_state_ << " to " << advance_state;
return;
+ }
switch (advance_state) {
case SyncSetupWizard::GAIA_LOGIN: {
@@ -432,19 +500,39 @@ void SyncSetupFlow::Advance(SyncSetupWizard::State advance_state) {
flow_handler_->ShowGaiaSuccessAndClose();
break;
}
- advance_state = SyncSetupWizard::CHOOSE_DATA_TYPES;
+ advance_state = SyncSetupWizard::CONFIGURE;
// Fall through.
- case SyncSetupWizard::CHOOSE_DATA_TYPES: {
+ case SyncSetupWizard::CONFIGURE: {
+ DictionaryValue args;
+ SyncSetupFlow::GetArgsForConfigure(service_, &args);
+ args.SetString("initialTab", "data-type");
+ flow_handler_->ShowConfigure(args);
+ break;
+ }
+ case SyncSetupWizard::CREATE_PASSPHRASE: {
DictionaryValue args;
- SyncSetupFlow::GetArgsForChooseDataTypes(service_, &args);
- flow_handler_->ShowChooseDataTypes(args);
+ args.SetString("mode", "new");
+ flow_handler_->ShowPassphraseEntry(args);
+ break;
+ }
+ case SyncSetupWizard::ENTER_PASSPHRASE: {
+ DictionaryValue args;
+ if (service_->IsUsingSecondaryPassphrase())
+ args.SetString("mode", "enter");
+ else
+ args.SetString("mode", "gaia");
+ flow_handler_->ShowPassphraseEntry(args);
break;
}
case SyncSetupWizard::SETUP_ABORTED_BY_PENDING_CLEAR: {
DictionaryValue args;
- SyncSetupFlow::GetArgsForChooseDataTypes(service_, &args);
+ SyncSetupFlow::GetArgsForConfigure(service_, &args);
args.SetBoolean("was_aborted", true);
- flow_handler_->ShowChooseDataTypes(args);
+ flow_handler_->ShowConfigure(args);
+ break;
+ }
+ case SyncSetupWizard::SETTING_UP: {
+ flow_handler_->ShowSettingUp();
break;
}
case SyncSetupWizard::FATAL_ERROR: {
@@ -492,8 +580,8 @@ SyncSetupFlow* SyncSetupFlow::Run(ProfileSyncService* service,
DictionaryValue args;
if (start == SyncSetupWizard::GAIA_LOGIN)
SyncSetupFlow::GetArgsForGaiaLogin(service, &args);
- else if (start == SyncSetupWizard::CHOOSE_DATA_TYPES)
- SyncSetupFlow::GetArgsForChooseDataTypes(service, &args);
+ else if (start == SyncSetupWizard::CONFIGURE)
+ SyncSetupFlow::GetArgsForConfigure(service, &args);
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
@@ -519,3 +607,55 @@ SyncSetupFlow* SyncSetupFlow::Run(ProfileSyncService* service,
#endif // defined(OS_MACOSX)
return flow;
}
+
+void SyncSetupFlow::OnUserSubmittedAuth(const std::string& username,
+ const std::string& password,
+ const std::string& captcha,
+ const std::string& access_code) {
+ service_->OnUserSubmittedAuth(username, password, captcha, access_code);
+}
+
+void SyncSetupFlow::OnUserConfigured(const SyncConfiguration& configuration) {
+ // Store the configuration in case we need more information.
+ configuration_ = configuration;
+ configuration_pending_ = true;
+
+ // If the user is activating secondary passphrase for the first time,
+ // we need to prompt them to enter one.
+ if (configuration.use_secondary_passphrase &&
+ !service_->IsUsingSecondaryPassphrase()) {
+ Advance(SyncSetupWizard::CREATE_PASSPHRASE);
+ return;
+ }
+
+ OnConfigurationComplete();
+}
+
+void SyncSetupFlow::OnConfigurationComplete() {
+ if (!configuration_pending_)
+ return;
+
+ // Go to the "loading..." screen."
+ Advance(SyncSetupWizard::SETTING_UP);
+
+ // If we are activating the passphrase, we need to have one supplied.
+ DCHECK(service_->IsUsingSecondaryPassphrase() ||
+ !configuration_.use_secondary_passphrase ||
+ configuration_.secondary_passphrase.length() > 0);
+
+ if (configuration_.use_secondary_passphrase &&
+ !service_->IsUsingSecondaryPassphrase())
+ service_->SetSecondaryPassphrase(configuration_.secondary_passphrase);
+
+ service_->OnUserChoseDatatypes(configuration_.sync_everything,
+ configuration_.data_types);
+
+ configuration_pending_ = false;
+}
+
+void SyncSetupFlow::OnPassphraseEntry(const std::string& passphrase) {
+ if (configuration_pending_) {
+ configuration_.secondary_passphrase = passphrase;
+ OnConfigurationComplete();
+ }
+}
diff --git a/chrome/browser/sync/sync_setup_flow.h b/chrome/browser/sync/sync_setup_flow.h
index baf43e6..01b48fc 100644
--- a/chrome/browser/sync/sync_setup_flow.h
+++ b/chrome/browser/sync/sync_setup_flow.h
@@ -15,12 +15,23 @@
#include "chrome/browser/dom_ui/html_dialog_ui.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_setup_wizard.h"
+#include "chrome/browser/sync/syncable/model_type.h"
#include "gfx/native_widget_types.h"
#include "grit/generated_resources.h"
class FlowHandler;
class SyncSetupFlowContainer;
+// A structure which contains all the configuration information for sync.
+// This can be stored or passed around when the configuration is managed
+// by multiple stages of the wizard.
+struct SyncConfiguration {
+ bool sync_everything;
+ syncable::ModelTypeSet data_types;
+ bool use_secondary_passphrase;
+ std::string secondary_passphrase;
+};
+
// The state machine used by SyncSetupWizard, exposed in its own header
// to facilitate testing of SyncSetupWizard. This class is used to open and
// run the html dialog and deletes itself when the dialog closes.
@@ -42,8 +53,8 @@ class SyncSetupFlow : public HtmlDialogUIDelegate {
const ProfileSyncService* service,
DictionaryValue* args);
- // Fills |args| with "user" and "error" arguments by querying |service|.
- static void GetArgsForChooseDataTypes(
+ // Fills |args| for the configure screen (Choose Data Types/Encryption)
+ static void GetArgsForConfigure(
ProfileSyncService* service,
DictionaryValue* args);
@@ -94,14 +105,13 @@ class SyncSetupFlow : public HtmlDialogUIDelegate {
void OnUserSubmittedAuth(const std::string& username,
const std::string& password,
const std::string& captcha,
- const std::string& access_code) {
- service_->OnUserSubmittedAuth(username, password, captcha, access_code);
- }
+ const std::string& access_code);
- void OnUserChoseDataTypes(bool sync_everything,
- syncable::ModelTypeSet& chosen_types) {
- service_->OnUserChoseDatatypes(sync_everything, chosen_types);
- }
+ void OnUserConfigured(const SyncConfiguration& configuration);
+
+ void OnPassphraseEntry(const std::string& passphrase);
+
+ void OnConfigurationComplete();
private:
FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, InitialStepLogin);
@@ -139,6 +149,11 @@ class SyncSetupFlow : public HtmlDialogUIDelegate {
FlowHandler* flow_handler_;
mutable bool owns_flow_handler_;
+ // The current configuration, held pending until all the information has
+ // been populated (possibly using multiple dialog states).
+ SyncConfiguration configuration_;
+ bool configuration_pending_;
+
// We need this to write the sentinel "setup completed" pref.
ProfileSyncService* service_;
@@ -181,13 +196,16 @@ class FlowHandler : public DOMMessageHandler {
// Callbacks from the page.
void HandleSubmitAuth(const ListValue* args);
- void HandleChooseDataTypes(const ListValue* args);
+ void HandleConfigure(const ListValue* args);
+ void HandlePassphraseEntry(const ListValue* args);
// These functions control which part of the HTML is visible.
void ShowGaiaLogin(const DictionaryValue& args);
void ShowGaiaSuccessAndClose();
void ShowGaiaSuccessAndSettingUp();
- void ShowChooseDataTypes(const DictionaryValue& args);
+ void ShowConfigure(const DictionaryValue& args);
+ void ShowPassphraseEntry(const DictionaryValue& args);
+ void ShowSettingUp();
void ShowSetupDone(const std::wstring& user);
void ShowFirstTimeDone(const std::wstring& user);
diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc
index 5a4ea7b..4e1547b 100644
--- a/chrome/browser/sync/sync_setup_wizard.cc
+++ b/chrome/browser/sync/sync_setup_wizard.cc
@@ -23,6 +23,17 @@
#include "grit/chromium_strings.h"
#include "grit/locale_settings.h"
+namespace {
+
+// Utility method to keep dictionary population code streamlined.
+void AddString(DictionaryValue* dictionary,
+ const std::string& key,
+ int resource_id) {
+ dictionary->SetString(key, l10n_util::GetStringUTF16(resource_id));
+}
+
+}
+
class SyncResourcesSource : public ChromeURLDataManager::DataSource {
public:
SyncResourcesSource()
@@ -61,136 +72,126 @@ const char* SyncResourcesSource::kCreateNewAccountUrl =
void SyncResourcesSource::StartDataRequest(const std::string& path_raw,
bool is_off_the_record, int request_id) {
- const char kSyncGaiaLoginPath[] = "gaialogin";
- const char kSyncChooseDataTypesPath[] = "choosedatatypes";
+ using l10n_util::GetStringUTF16;
+ using l10n_util::GetStringFUTF16;
+
const char kSyncSetupFlowPath[] = "setup";
+ const char kSyncGaiaLoginPath[] = "gaialogin";
+ const char kSyncConfigurePath[] = "configure";
+ const char kSyncPassphrasePath[] = "passphrase";
+ const char kSyncSettingUpPath[] = "settingup";
const char kSyncSetupDonePath[] = "setupdone";
std::string response;
+ DictionaryValue strings;
+ DictionaryValue* dict = &strings;
+ int html_resource_id = 0;
if (path_raw == kSyncGaiaLoginPath) {
- DictionaryValue localized_strings;
+ html_resource_id = IDR_GAIA_LOGIN_HTML;
// Start by setting the per-locale URLs we show on the setup wizard.
- localized_strings.SetString("invalidpasswordhelpurl",
- GetLocalizedUrl(kInvalidPasswordHelpUrl));
- localized_strings.SetString("cannotaccessaccounturl",
- GetLocalizedUrl(kCanNotAccessAccountUrl));
- localized_strings.SetString("createnewaccounturl",
- GetLocalizedUrl(kCreateNewAccountUrl));
-
- localized_strings.SetString("settingupsync",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP_SYNC));
- localized_strings.SetString("introduction",
- l10n_util::GetStringFUTF16(IDS_SYNC_LOGIN_INTRODUCTION,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
- localized_strings.SetString("signinprefix",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SIGNIN_PREFIX));
- localized_strings.SetString("signinsuffix",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SIGNIN_SUFFIX));
- localized_strings.SetString("cannotbeblank",
- l10n_util::GetStringUTF16(IDS_SYNC_CANNOT_BE_BLANK));
- localized_strings.SetString("emaillabel",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_EMAIL));
- localized_strings.SetString("passwordlabel",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_PASSWORD));
- localized_strings.SetString("invalidcredentials",
- l10n_util::GetStringUTF16(IDS_SYNC_INVALID_USER_CREDENTIALS));
- localized_strings.SetString("signin",
- l10n_util::GetStringUTF16(IDS_SYNC_SIGNIN));
- localized_strings.SetString("couldnotconnect",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_COULD_NOT_CONNECT));
- localized_strings.SetString("cannotaccessaccount",
- l10n_util::GetStringUTF16(IDS_SYNC_CANNOT_ACCESS_ACCOUNT));
- localized_strings.SetString("createaccount",
- l10n_util::GetStringUTF16(IDS_SYNC_CREATE_ACCOUNT));
- localized_strings.SetString("cancel",
- l10n_util::GetStringUTF16(IDS_CANCEL));
- localized_strings.SetString("settingup",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP));
- localized_strings.SetString("success",
- l10n_util::GetStringUTF16(IDS_SYNC_SUCCESS));
- localized_strings.SetString("errorsigningin",
- l10n_util::GetStringUTF16(IDS_SYNC_ERROR_SIGNING_IN));
- localized_strings.SetString("captchainstructions",
- l10n_util::GetStringUTF16(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS));
-
- localized_strings.SetString("invalidaccesscode",
- l10n_util::GetStringUTF16(IDS_SYNC_INVALID_ACCESS_CODE_LABEL));
- localized_strings.SetString("enteraccesscode",
- l10n_util::GetStringUTF16(IDS_SYNC_ENTER_ACCESS_CODE_LABEL));
- localized_strings.SetString("getaccesscodehelp",
- l10n_util::GetStringUTF16(IDS_SYNC_ACCESS_CODE_HELP_LABEL));
- localized_strings.SetString("getaccesscodeurl",
- l10n_util::GetStringUTF16(IDS_SYNC_GET_ACCESS_CODE_URL));
-
- static const base::StringPiece html(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_GAIA_LOGIN_HTML));
- SetFontAndTextDirection(&localized_strings);
- response = jstemplate_builder::GetI18nTemplateHtml(
- html, &localized_strings);
- } else if (path_raw == kSyncChooseDataTypesPath) {
- DictionaryValue localized_strings;
- localized_strings.SetString("choosedatatypesheader",
- l10n_util::GetStringUTF16(IDS_SYNC_CHOOSE_DATATYPES_HEADER));
- localized_strings.SetString("choosedatatypesinstructions",
- l10n_util::GetStringFUTF16(IDS_SYNC_CHOOSE_DATATYPES_INSTRUCTIONS,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
- localized_strings.SetString("keepeverythingsynced",
- l10n_util::GetStringUTF16(IDS_SYNC_EVERYTHING));
- localized_strings.SetString("choosedatatypes",
- l10n_util::GetStringUTF16(IDS_SYNC_CHOOSE_DATATYPES));
- localized_strings.SetString("bookmarks",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_BOOKMARKS));
- localized_strings.SetString("preferences",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_PREFERENCES));
- localized_strings.SetString("autofill",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_AUTOFILL));
- localized_strings.SetString("themes",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_THEMES));
- localized_strings.SetString("passwords",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_PASSWORDS));
- localized_strings.SetString("extensions",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_EXTENSIONS));
- localized_strings.SetString("typedurls",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_TYPED_URLS));
- localized_strings.SetString("apps",
- l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_APPS));
- localized_strings.SetString("synczerodatatypeserror",
- l10n_util::GetStringUTF16(IDS_SYNC_ZERO_DATA_TYPES_ERROR));
- localized_strings.SetString("setupabortederror",
- l10n_util::GetStringUTF16(IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR));
- localized_strings.SetString("ok",
- l10n_util::GetStringUTF16(IDS_OK));
- localized_strings.SetString("cancel",
- l10n_util::GetStringUTF16(IDS_CANCEL));
- localized_strings.SetString("settingup",
- l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP));
- static const base::StringPiece html(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_SYNC_CHOOSE_DATATYPES_HTML));
- SetFontAndTextDirection(&localized_strings);
- response = jstemplate_builder::GetI18nTemplateHtml(
- html, &localized_strings);
+ dict->SetString("invalidpasswordhelpurl",
+ GetLocalizedUrl(kInvalidPasswordHelpUrl));
+ dict->SetString("cannotaccessaccounturl",
+ GetLocalizedUrl(kCanNotAccessAccountUrl));
+ dict->SetString("createnewaccounturl",
+ GetLocalizedUrl(kCreateNewAccountUrl));
+ AddString(dict, "settingupsync", IDS_SYNC_LOGIN_SETTING_UP_SYNC);
+ dict->SetString("introduction",
+ GetStringFUTF16(IDS_SYNC_LOGIN_INTRODUCTION,
+ GetStringUTF16(IDS_PRODUCT_NAME)));
+ AddString(dict, "signinprefix", IDS_SYNC_LOGIN_SIGNIN_PREFIX);
+ AddString(dict, "signinsuffix", IDS_SYNC_LOGIN_SIGNIN_SUFFIX);
+ AddString(dict, "cannotbeblank", IDS_SYNC_CANNOT_BE_BLANK);
+ AddString(dict, "emaillabel", IDS_SYNC_LOGIN_EMAIL);
+ AddString(dict, "passwordlabel", IDS_SYNC_LOGIN_PASSWORD);
+ AddString(dict, "invalidcredentials", IDS_SYNC_INVALID_USER_CREDENTIALS);
+ AddString(dict, "signin", IDS_SYNC_SIGNIN);
+ AddString(dict, "couldnotconnect", IDS_SYNC_LOGIN_COULD_NOT_CONNECT);
+ AddString(dict, "cannotaccessaccount", IDS_SYNC_CANNOT_ACCESS_ACCOUNT);
+ AddString(dict, "createaccount", IDS_SYNC_CREATE_ACCOUNT);
+ AddString(dict, "cancel", IDS_CANCEL);
+ AddString(dict, "settingup", IDS_SYNC_LOGIN_SETTING_UP);
+ AddString(dict, "success", IDS_SYNC_SUCCESS);
+ AddString(dict, "errorsigningin", IDS_SYNC_ERROR_SIGNING_IN);
+ AddString(dict, "captchainstructions", IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS);
+
+ AddString(dict, "invalidaccesscode", IDS_SYNC_INVALID_ACCESS_CODE_LABEL);
+ AddString(dict, "enteraccesscode", IDS_SYNC_ENTER_ACCESS_CODE_LABEL);
+ AddString(dict, "getaccesscodehelp", IDS_SYNC_ACCESS_CODE_HELP_LABEL);
+ AddString(dict, "getaccesscodeurl", IDS_SYNC_GET_ACCESS_CODE_URL);
+ } else if (path_raw == kSyncConfigurePath) {
+ html_resource_id = IDR_SYNC_CONFIGURE_HTML;
+
+ AddString(dict, "dataTypes", IDS_SYNC_DATA_TYPES_TAB_NAME);
+ AddString(dict, "encryption", IDS_SYNC_ENCRYPTION_TAB_NAME);
+
+ // Stuff for the choose data types localized.
+ AddString(dict, "choosedatatypesheader", IDS_SYNC_CHOOSE_DATATYPES_HEADER);
+ dict->SetString("choosedatatypesinstructions",
+ GetStringFUTF16(IDS_SYNC_CHOOSE_DATATYPES_INSTRUCTIONS,
+ GetStringUTF16(IDS_PRODUCT_NAME)));
+ AddString(dict, "keepeverythingsynced", IDS_SYNC_EVERYTHING);
+ AddString(dict, "choosedatatypes", IDS_SYNC_CHOOSE_DATATYPES);
+ AddString(dict, "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS);
+ AddString(dict, "preferences", IDS_SYNC_DATATYPE_PREFERENCES);
+ AddString(dict, "autofill", IDS_SYNC_DATATYPE_AUTOFILL);
+ AddString(dict, "themes", IDS_SYNC_DATATYPE_THEMES);
+ AddString(dict, "passwords", IDS_SYNC_DATATYPE_PASSWORDS);
+ AddString(dict, "extensions", IDS_SYNC_DATATYPE_EXTENSIONS);
+ AddString(dict, "typedurls", IDS_SYNC_DATATYPE_TYPED_URLS);
+ AddString(dict, "apps", IDS_SYNC_DATATYPE_APPS);
+ AddString(dict, "synczerodatatypeserror", IDS_SYNC_ZERO_DATA_TYPES_ERROR);
+ AddString(dict, "abortederror", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR);
+
+ // Stuff for the encryption tab.
+ dict->SetString("encryptionInstructions",
+ GetStringFUTF16(IDS_SYNC_ENCRYPTION_INSTRUCTIONS,
+ GetStringUTF16(IDS_PRODUCT_NAME)));
+ AddString(dict, "encryptAllLabel", IDS_SYNC_ENCRYPT_ALL_LABEL);
+ AddString(dict, "usePassphraseLabel", IDS_SYNC_PASSPHRASE_CHECKBOX_LABEL);
+ AddString(dict, "passphraseWarning", IDS_SYNC_PASSPHRASE_WARNING);
+
+ // Stuff for the footer.
+ AddString(dict, "ok", IDS_OK);
+ AddString(dict, "cancel", IDS_CANCEL);
+ } else if (path_raw == kSyncPassphrasePath) {
+ html_resource_id = IDR_SYNC_PASSPHRASE_HTML;
+ AddString(dict, "newPassphraseTitle", IDS_SYNC_NEW_PASSPHRASE_TITLE);
+ AddString(dict, "newPassphraseBody", IDS_SYNC_NEW_PASSPHRASE_BODY);
+ AddString(dict, "enterPassphraseTitle", IDS_SYNC_ENTER_PASSPHRASE_TITLE);
+ AddString(dict, "enterPassphraseBody", IDS_SYNC_ENTER_PASSPHRASE_BODY);
+ AddString(dict, "gaiaPassphraseTitle", IDS_SYNC_GAIA_PASSPHRASE_TITLE);
+ AddString(dict, "gaiaPassphraseBody", IDS_SYNC_GAIA_PASSPHRASE_BODY);
+ AddString(dict, "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL);
+ AddString(dict, "ok", IDS_OK);
+ AddString(dict, "cancel", IDS_CANCEL);
+ } else if (path_raw == kSyncSettingUpPath) {
+ html_resource_id = IDR_SYNC_SETTING_UP_HTML;
+
+ AddString(dict, "settingup", IDS_SYNC_LOGIN_SETTING_UP);
+ AddString(dict, "cancel", IDS_CANCEL);
} else if (path_raw == kSyncSetupDonePath) {
- DictionaryValue localized_strings;
- localized_strings.SetString("success",
- l10n_util::GetStringUTF16(IDS_SYNC_SUCCESS));
- localized_strings.SetString("setupsummary",
- l10n_util::GetStringFUTF16(IDS_SYNC_SETUP_ALL_DONE,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
- localized_strings.SetString("firsttimesetupsummary",
- l10n_util::GetStringUTF16(IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE));
- localized_strings.SetString("okay",
- l10n_util::GetStringUTF16(IDS_SYNC_SETUP_OK_BUTTON_LABEL));
- static const base::StringPiece html(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_SYNC_SETUP_DONE_HTML));
- SetFontAndTextDirection(&localized_strings);
- response = jstemplate_builder::GetI18nTemplateHtml(
- html, &localized_strings);
+ html_resource_id = IDR_SYNC_SETUP_DONE_HTML;
+
+ AddString(dict, "success", IDS_SYNC_SUCCESS);
+ dict->SetString("setupsummary",
+ GetStringFUTF16(IDS_SYNC_SETUP_ALL_DONE,
+ GetStringUTF16(IDS_PRODUCT_NAME)));
+ AddString(dict, "firsttimesummary", IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE);
+ AddString(dict, "okay", IDS_SYNC_SETUP_OK_BUTTON_LABEL);
} else if (path_raw == kSyncSetupFlowPath) {
- static const base::StringPiece html(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML));
- response = html.as_string();
+ html_resource_id = IDR_SYNC_SETUP_FLOW_HTML;
+ }
+
+ if (html_resource_id > 0) {
+ const base::StringPiece html(
+ ResourceBundle::GetSharedInstance().GetRawDataResource(
+ html_resource_id));
+ SetFontAndTextDirection(dict);
+ response = jstemplate_builder::GetI18nTemplateHtml(html, dict);
}
+
// Send the response.
scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes);
html_bytes->data.resize(response.size());
@@ -278,7 +279,7 @@ SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun(
State result = FATAL_ERROR;
if (start_state == GAIA_LOGIN) {
result = GAIA_SUCCESS;
- } else if (start_state == CHOOSE_DATA_TYPES) {
+ } else if (start_state == CONFIGURE) {
result = DONE;
}
DCHECK_NE(FATAL_ERROR, result) <<
diff --git a/chrome/browser/sync/sync_setup_wizard.h b/chrome/browser/sync/sync_setup_wizard.h
index e7d1a82..dad3fa9 100644
--- a/chrome/browser/sync/sync_setup_wizard.h
+++ b/chrome/browser/sync/sync_setup_wizard.h
@@ -21,23 +21,26 @@ class SyncSetupWizard {
// A login attempt succeeded. This will wait for an explicit transition
// (via Step) to the next state.
GAIA_SUCCESS,
- // Show the screen that lets you click either "Keep everything synced" or
- // "Choose which data types to sync", and checkboxes for each data type.
- CHOOSE_DATA_TYPES,
- // Show the screen that lets you create a passphrase (if you've never set
- // one up before).
+ // Show the screen that lets you configure sync.
+ // There are two tabs:
+ // Data Types --
+ // Choose either "Keep everything synced" or
+ // "Choose which data types to sync", and checkboxes for each data type.
+ // Encryption --
+ // Choose what to encrypt and whether to use a passphrase.
+ CONFIGURE,
+ // Show the screen that lets you enter a new passphrase
CREATE_PASSPHRASE,
- // Show the screen that lets you enter the passphrase (if you've set one up
- // on another machine).
+ // Show the screen that prompts for your passphrase
ENTER_PASSPHRASE,
- // Show the screen that lets you reset your passphrase (if you forgot it).
- RESET_PASSPHRASE,
// The panic switch. Something went terribly wrong during setup and we
// can't recover.
FATAL_ERROR,
// The client can't set up sync at the moment due to a concurrent operation
// to clear cloud data being in progress on the server.
SETUP_ABORTED_BY_PENDING_CLEAR,
+ // Loading screen with spinny throbber.
+ SETTING_UP,
// A final state for when setup completes and it is possible it is the
// user's first time (globally speaking) as the cloud doesn't have any
// bookmarks. We show additional info in this case to explain setting up
diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc
index e4f53f0..aff176a 100644
--- a/chrome/browser/sync/sync_setup_wizard_unittest.cc
+++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc
@@ -285,12 +285,13 @@ TEST_F(SyncSetupWizardTest, InitialStepLogin) {
EXPECT_TRUE(wizard_->IsVisible());
EXPECT_FALSE(test_window_->TestAndResetWasShowHTMLDialogCalled());
// In a non-discrete run, GAIA_SUCCESS immediately transitions you to
- // CHOOSE_DATA_TYPES.
- EXPECT_EQ(SyncSetupWizard::CHOOSE_DATA_TYPES,
+ // CONFIGURE.
+ EXPECT_EQ(SyncSetupWizard::CONFIGURE,
test_window_->flow()->current_state_);
// That's all we're testing here, just move on to DONE. We'll test the
// "choose data types" scenarios elsewhere.
+ wizard_->Step(SyncSetupWizard::SETTING_UP); // No merge and sync.
wizard_->Step(SyncSetupWizard::DONE); // No merge and sync.
EXPECT_TRUE(wizard_->IsVisible());
EXPECT_FALSE(test_window_->TestAndResetWasShowHTMLDialogCalled());
@@ -300,7 +301,7 @@ TEST_F(SyncSetupWizardTest, InitialStepLogin) {
TEST_F(SyncSetupWizardTest, ChooseDataTypesSetsPrefs) {
SKIP_TEST_ON_MACOSX();
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
- wizard_->Step(SyncSetupWizard::CHOOSE_DATA_TYPES);
+ wizard_->Step(SyncSetupWizard::CONFIGURE);
ListValue data_type_choices_value;
std::string data_type_choices = "{\"keepEverythingSynced\":false,";
@@ -308,12 +309,12 @@ TEST_F(SyncSetupWizardTest, ChooseDataTypesSetsPrefs) {
data_type_choices += "\"syncThemes\":false,\"syncPasswords\":false,";
data_type_choices += "\"syncAutofill\":false,\"syncExtensions\":false,";
data_type_choices += "\"syncTypedUrls\":true,\"syncApps\":true,";
- data_type_choices += "\"syncSessions\":false}";
+ data_type_choices += "\"syncSessions\":false,\"usePassphrase\":false}";
data_type_choices_value.Append(new StringValue(data_type_choices));
// Simulate the user choosing data types; bookmarks, prefs, typed
// URLS, and apps are on, the rest are off.
- test_window_->flow()->flow_handler_->HandleChooseDataTypes(
+ test_window_->flow()->flow_handler_->HandleConfigure(
&data_type_choices_value);
EXPECT_TRUE(wizard_->IsVisible());
EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled());
@@ -379,7 +380,7 @@ TEST_F(SyncSetupWizardTest, InvalidTransitions) {
test_window_->flow()->current_state_);
wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
- EXPECT_EQ(SyncSetupWizard::CHOOSE_DATA_TYPES,
+ EXPECT_EQ(SyncSetupWizard::CONFIGURE,
test_window_->flow()->current_state_);
wizard_->Step(SyncSetupWizard::FATAL_ERROR);
@@ -390,6 +391,7 @@ TEST_F(SyncSetupWizardTest, FullSuccessfulRunSetsPref) {
SKIP_TEST_ON_MACOSX();
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
+ wizard_->Step(SyncSetupWizard::SETTING_UP);
wizard_->Step(SyncSetupWizard::DONE);
test_window_->CloseDialog();
EXPECT_FALSE(wizard_->IsVisible());
@@ -401,6 +403,7 @@ TEST_F(SyncSetupWizardTest, FirstFullSuccessfulRunSetsPref) {
SKIP_TEST_ON_MACOSX();
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
+ wizard_->Step(SyncSetupWizard::SETTING_UP);
wizard_->Step(SyncSetupWizard::DONE_FIRST_TIME);
test_window_->CloseDialog();
EXPECT_FALSE(wizard_->IsVisible());
@@ -428,7 +431,7 @@ TEST_F(SyncSetupWizardTest, DiscreteRunChooseDataTypes) {
test_window_->CloseDialog();
EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled());
- wizard_->Step(SyncSetupWizard::CHOOSE_DATA_TYPES);
+ wizard_->Step(SyncSetupWizard::CONFIGURE);
EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled());
EXPECT_EQ(SyncSetupWizard::DONE, test_window_->flow()->end_state_);
@@ -446,7 +449,7 @@ TEST_F(SyncSetupWizardTest, DiscreteRunChooseDataTypesAbortedByPendingClear) {
test_window_->CloseDialog();
EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled());
- wizard_->Step(SyncSetupWizard::CHOOSE_DATA_TYPES);
+ wizard_->Step(SyncSetupWizard::CONFIGURE);
EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled());
EXPECT_EQ(SyncSetupWizard::DONE, test_window_->flow()->end_state_);
wizard_->Step(SyncSetupWizard::SETUP_ABORTED_BY_PENDING_CLEAR);
@@ -463,6 +466,7 @@ TEST_F(SyncSetupWizardTest, DiscreteRunGaiaLogin) {
// For a discrete run, we need to have ran through setup once.
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
+ wizard_->Step(SyncSetupWizard::SETTING_UP);
wizard_->Step(SyncSetupWizard::DONE);
test_window_->CloseDialog();
EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled());