| Index: chrome/browser/ui/webui/sync_setup_handler.cc
|
| diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
|
| index c47c178bb6e83e94ca7f24ca90d74caa4417fd18..8dcfaa85384b0cfa83f9f5cb00e0e4ddf6b560a8 100644
|
| --- a/chrome/browser/ui/webui/sync_setup_handler.cc
|
| +++ b/chrome/browser/ui/webui/sync_setup_handler.cc
|
| @@ -264,6 +264,8 @@ void SyncSetupHandler::GetStaticLocalizedValues(
|
| { "encryptedDataTypesTitle", IDS_SYNC_ENCRYPTION_DATA_TYPES_TITLE },
|
| { "encryptSensitiveOption", IDS_SYNC_ENCRYPT_SENSITIVE_DATA },
|
| { "encryptAllOption", IDS_SYNC_ENCRYPT_ALL_DATA },
|
| + { "encryptAllOption", IDS_SYNC_ENCRYPT_ALL_DATA },
|
| + { "statusNotConnected", IDS_SYNC_STATUS_NOT_CONNECTED }
|
| };
|
|
|
| RegisterStrings(localized_strings, resources, arraysize(resources));
|
| @@ -338,10 +340,7 @@ void SyncSetupHandler::Focus() {
|
| }
|
|
|
| void SyncSetupHandler::OnDidClosePage(const ListValue* args) {
|
| - if (flow_) {
|
| - flow_->OnDialogClosed(std::string());
|
| - flow_ = NULL;
|
| - }
|
| + CloseSyncSetup();
|
| }
|
|
|
| void SyncSetupHandler::HandleSubmitAuth(const ListValue* args) {
|
| @@ -416,6 +415,38 @@ void SyncSetupHandler::HandlePassphraseCancel(const ListValue* args) {
|
| }
|
|
|
| void SyncSetupHandler::HandleAttachHandler(const ListValue* args) {
|
| + OpenSyncSetup();
|
| +}
|
| +
|
| +void SyncSetupHandler::HandleShowErrorUI(const ListValue* args) {
|
| + DCHECK(!flow_);
|
| +
|
| + ProfileSyncService* service =
|
| + web_ui_->GetProfile()->GetProfileSyncService();
|
| + DCHECK(service);
|
| +
|
| + service->get_wizard().Step(SyncSetupWizard::NONFATAL_ERROR);
|
| +
|
| + // The SyncSetupFlow will set itself as the |flow_|.
|
| + if (!service->get_wizard().AttachSyncSetupHandler(this)) {
|
| + web_ui_->CallJavascriptFunction("OptionsPage.closeOverlay");
|
| + service->get_wizard().Focus();
|
| + }
|
| +}
|
| +
|
| +void SyncSetupHandler::HandleShowSetupUI(const ListValue* args) {
|
| + DCHECK(!flow_);
|
| + ShowSetupUI();
|
| +}
|
| +
|
| +void SyncSetupHandler::CloseSyncSetup() {
|
| + if (flow_) {
|
| + flow_->OnDialogClosed(std::string());
|
| + flow_ = NULL;
|
| + }
|
| +}
|
| +
|
| +void SyncSetupHandler::OpenSyncSetup() {
|
| DCHECK(web_ui_);
|
| DCHECK(!flow_);
|
|
|
| @@ -440,24 +471,3 @@ void SyncSetupHandler::HandleAttachHandler(const ListValue* args) {
|
| service->get_wizard().Focus();
|
| }
|
| }
|
| -
|
| -void SyncSetupHandler::HandleShowErrorUI(const ListValue* args) {
|
| - DCHECK(!flow_);
|
| -
|
| - ProfileSyncService* service =
|
| - web_ui_->GetProfile()->GetProfileSyncService();
|
| - DCHECK(service);
|
| -
|
| - service->get_wizard().Step(SyncSetupWizard::NONFATAL_ERROR);
|
| -
|
| - // The SyncSetupFlow will set itself as the |flow_|.
|
| - if (!service->get_wizard().AttachSyncSetupHandler(this)) {
|
| - web_ui_->CallJavascriptFunction("OptionsPage.closeOverlay");
|
| - service->get_wizard().Focus();
|
| - }
|
| -}
|
| -
|
| -void SyncSetupHandler::HandleShowSetupUI(const ListValue* args) {
|
| - DCHECK(!flow_);
|
| - ShowSetupUI();
|
| -}
|
|
|