| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 GetStringFUTF16(IDS_SYNC_PROMO_TITLE, | 235 GetStringFUTF16(IDS_SYNC_PROMO_TITLE, |
| 236 GetStringUTF16(IDS_PRODUCT_NAME))); | 236 GetStringUTF16(IDS_PRODUCT_NAME))); |
| 237 localized_strings->SetString( | 237 localized_strings->SetString( |
| 238 "promoMessageTitle", | 238 "promoMessageTitle", |
| 239 GetStringFUTF16(IDS_SYNC_PROMO_MESSAGE_TITLE, | 239 GetStringFUTF16(IDS_SYNC_PROMO_MESSAGE_TITLE, |
| 240 GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); | 240 GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); |
| 241 | 241 |
| 242 static OptionsStringResource resources[] = { | 242 static OptionsStringResource resources[] = { |
| 243 { "syncSetupOverlayTitle", IDS_SYNC_SETUP_TITLE }, | 243 { "syncSetupOverlayTitle", IDS_SYNC_SETUP_TITLE }, |
| 244 { "syncSetupConfigureTitle", IDS_SYNC_SETUP_CONFIGURE_TITLE }, | 244 { "syncSetupConfigureTitle", IDS_SYNC_SETUP_CONFIGURE_TITLE }, |
| 245 { "signinPrefix", IDS_SYNC_LOGIN_SIGNIN_PREFIX }, | |
| 246 { "signinSuffix", IDS_SYNC_LOGIN_SIGNIN_SUFFIX }, | |
| 247 { "cannotBeBlank", IDS_SYNC_CANNOT_BE_BLANK }, | 245 { "cannotBeBlank", IDS_SYNC_CANNOT_BE_BLANK }, |
| 248 { "emailLabel", IDS_SYNC_LOGIN_EMAIL }, | 246 { "emailLabel", IDS_SYNC_LOGIN_EMAIL_NEW_LINE }, |
| 249 { "passwordLabel", IDS_SYNC_LOGIN_PASSWORD }, | 247 { "passwordLabel", IDS_SYNC_LOGIN_PASSWORD_NEW_LINE }, |
| 250 { "invalidCredentials", IDS_SYNC_INVALID_USER_CREDENTIALS }, | 248 { "invalidCredentials", IDS_SYNC_INVALID_USER_CREDENTIALS }, |
| 251 { "signin", IDS_SYNC_SIGNIN }, | 249 { "signin", IDS_SYNC_SIGNIN }, |
| 252 { "couldNotConnect", IDS_SYNC_LOGIN_COULD_NOT_CONNECT }, | 250 { "couldNotConnect", IDS_SYNC_LOGIN_COULD_NOT_CONNECT }, |
| 253 { "unrecoverableError", IDS_SYNC_UNRECOVERABLE_ERROR }, | 251 { "unrecoverableError", IDS_SYNC_UNRECOVERABLE_ERROR }, |
| 254 { "errorLearnMore", IDS_LEARN_MORE }, | 252 { "errorLearnMore", IDS_LEARN_MORE }, |
| 255 { "unrecoverableErrorHelpURL", IDS_SYNC_UNRECOVERABLE_ERROR_HELP_URL }, | 253 { "unrecoverableErrorHelpURL", IDS_SYNC_UNRECOVERABLE_ERROR_HELP_URL }, |
| 256 { "cannotAccessAccount", IDS_SYNC_CANNOT_ACCESS_ACCOUNT }, | 254 { "cannotAccessAccount", IDS_SYNC_CANNOT_ACCESS_ACCOUNT }, |
| 257 { "createAccount", IDS_SYNC_CREATE_ACCOUNT }, | 255 { "createAccount", IDS_SYNC_CREATE_ACCOUNT }, |
| 256 { "createAccountPrefix", IDS_SYNC_CREATE_ACCOUNT_PREFIX }, |
| 258 { "cancel", IDS_CANCEL }, | 257 { "cancel", IDS_CANCEL }, |
| 259 { "settingUp", IDS_SYNC_LOGIN_SETTING_UP }, | 258 { "settingUp", IDS_SYNC_LOGIN_SETTING_UP }, |
| 260 { "errorSigningIn", IDS_SYNC_ERROR_SIGNING_IN }, | 259 { "errorSigningIn", IDS_SYNC_ERROR_SIGNING_IN }, |
| 260 { "signinHeader", IDS_SYNC_PROMO_SIGNIN_HEADER}, |
| 261 { "captchaInstructions", IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS }, | 261 { "captchaInstructions", IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS }, |
| 262 { "invalidAccessCode", IDS_SYNC_INVALID_ACCESS_CODE_LABEL }, | 262 { "invalidAccessCode", IDS_SYNC_INVALID_ACCESS_CODE_LABEL }, |
| 263 { "enterAccessCode", IDS_SYNC_ENTER_ACCESS_CODE_LABEL }, | 263 { "enterAccessCode", IDS_SYNC_ENTER_ACCESS_CODE_LABEL }, |
| 264 { "getAccessCodeHelp", IDS_SYNC_ACCESS_CODE_HELP_LABEL }, | 264 { "getAccessCodeHelp", IDS_SYNC_ACCESS_CODE_HELP_LABEL }, |
| 265 { "getAccessCodeURL", IDS_SYNC_GET_ACCESS_CODE_URL }, | 265 { "getAccessCodeURL", IDS_SYNC_GET_ACCESS_CODE_URL }, |
| 266 { "syncAllDataTypes", IDS_SYNC_EVERYTHING }, | 266 { "syncAllDataTypes", IDS_SYNC_EVERYTHING }, |
| 267 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, | 267 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, |
| 268 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, | 268 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, |
| 269 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, | 269 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, |
| 270 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, | 270 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 600 } |
| 601 | 601 |
| 602 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { | 602 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { |
| 603 DictionaryValue args; | 603 DictionaryValue args; |
| 604 Profile* profile = Profile::FromWebUI(web_ui_); | 604 Profile* profile = Profile::FromWebUI(web_ui_); |
| 605 ProfileSyncService* service = profile->GetProfileSyncService(); | 605 ProfileSyncService* service = profile->GetProfileSyncService(); |
| 606 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); | 606 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); |
| 607 args.SetString("error_message", error_message); | 607 args.SetString("error_message", error_message); |
| 608 ShowGaiaLogin(args); | 608 ShowGaiaLogin(args); |
| 609 } | 609 } |
| OLD | NEW |