summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/options/options_sync_setup_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/webui/options/options_sync_setup_handler.cc')
-rw-r--r--chrome/browser/ui/webui/options/options_sync_setup_handler.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/ui/webui/options/options_sync_setup_handler.cc b/chrome/browser/ui/webui/options/options_sync_setup_handler.cc
index 85ad94d..af88e2c 100644
--- a/chrome/browser/ui/webui/options/options_sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/options/options_sync_setup_handler.cc
@@ -16,6 +16,24 @@ OptionsSyncSetupHandler::OptionsSyncSetupHandler(
OptionsSyncSetupHandler::~OptionsSyncSetupHandler() {
}
+void OptionsSyncSetupHandler::StepWizardForShowSetupUI() {
+ ProfileSyncService* service(ProfileSyncServiceFactory::
+ GetInstance()->GetForProfile(Profile::FromWebUI(web_ui())));
+ DCHECK(service);
+
+ // We should bring up either a login or a configure flow based on the state of
+ // sync.
+ if (service->HasSyncSetupCompleted()) {
+ if (service->IsPassphraseRequiredForDecryption()) {
+ service->get_wizard().Step(SyncSetupWizard::ENTER_PASSPHRASE);
+ } else {
+ service->get_wizard().Step(SyncSetupWizard::CONFIGURE);
+ }
+ } else {
+ service->get_wizard().Step(SyncSetupWizard::GetLoginState());
+ }
+}
+
void OptionsSyncSetupHandler::ShowSetupUI() {
// Show the Sync Setup page.
scoped_ptr<Value> page(Value::CreateStringValue("syncSetup"));