summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sync_setup_flow.h
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 04:55:44 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 04:55:44 +0000
commitc976938f96f5f9296d25cbc41d8fcea5bce74627 (patch)
tree73024d2e03eb37934b1271bcc93b78e3282fe15c /chrome/browser/sync/sync_setup_flow.h
parent88efa012201af24b14072298d7a24b64fc1c02a1 (diff)
downloadchromium_src-c976938f96f5f9296d25cbc41d8fcea5bce74627.zip
chromium_src-c976938f96f5f9296d25cbc41d8fcea5bce74627.tar.gz
chromium_src-c976938f96f5f9296d25cbc41d8fcea5bce74627.tar.bz2
Add UI for setting the encryption passphrase.
-Tabbed version of configure page which offers both data type selection and passphrase selection -New passphrase page which doubles for creation and entry. -New common loading page which contains the spinny. -Backend changes. BUG=48706 Review URL: http://codereview.chromium.org/3655004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_setup_flow.h')
-rw-r--r--chrome/browser/sync/sync_setup_flow.h40
1 files changed, 29 insertions, 11 deletions
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);