| Index: chrome/browser/ui/webui/options/sync_options_handler.cc
|
| diff --git a/chrome/browser/ui/webui/options/sync_options_handler.cc b/chrome/browser/ui/webui/options/sync_options_handler.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ef4ca39cdb1bf9128d76f416eaa3d7160afbd922
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/webui/options/sync_options_handler.cc
|
| @@ -0,0 +1,131 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/ui/webui/options/sync_options_handler.h"
|
| +
|
| +#include "base/strings/utf_string_conversions.h"
|
| +#include "base/values.h"
|
| +#include "chrome/app/chrome_command_ids.h"
|
| +#include "chrome/browser/browser_process.h"
|
| +#include "chrome/common/url_constants.h"
|
| +#include "chrome/grit/chromium_strings.h"
|
| +#include "chrome/grit/generated_resources.h"
|
| +#include "components/google/core/browser/google_util.h"
|
| +#include "grit/components_strings.h"
|
| +#include "ui/base/l10n/l10n_util.h"
|
| +#include "url/gurl.h"
|
| +
|
| +using l10n_util::GetStringFUTF16;
|
| +using l10n_util::GetStringUTF16;
|
| +
|
| +SyncOptionsHandler::SyncOptionsHandler(content::WebUI* web_ui)
|
| + : sync_setup_handler_(web_ui) {}
|
| +
|
| +SyncOptionsHandler::~SyncOptionsHandler() {}
|
| +
|
| +void SyncOptionsHandler::GetLocalizedValues(
|
| + base::DictionaryValue* localized_strings) {
|
| + DCHECK(localized_strings);
|
| +
|
| + base::string16 product_name(GetStringUTF16(IDS_PRODUCT_NAME));
|
| + localized_strings->SetString(
|
| + "chooseDataTypesInstructions",
|
| + GetStringFUTF16(IDS_SYNC_CHOOSE_DATATYPES_INSTRUCTIONS, product_name));
|
| + localized_strings->SetString(
|
| + "encryptionInstructions",
|
| + GetStringFUTF16(IDS_SYNC_ENCRYPTION_INSTRUCTIONS, product_name));
|
| + localized_strings->SetString(
|
| + "encryptionHelpURL", chrome::kSyncEncryptionHelpURL);
|
| + localized_strings->SetString(
|
| + "encryptionSectionMessage",
|
| + GetStringFUTF16(IDS_SYNC_ENCRYPTION_SECTION_MESSAGE, product_name));
|
| + localized_strings->SetString(
|
| + "passphraseRecover",
|
| + GetStringFUTF16(
|
| + IDS_SYNC_PASSPHRASE_RECOVER,
|
| + base::ASCIIToUTF16(
|
| + google_util::AppendGoogleLocaleParam(
|
| + GURL(chrome::kSyncGoogleDashboardURL),
|
| + g_browser_process->GetApplicationLocale()).spec())));
|
| + localized_strings->SetString(
|
| + "stopSyncingExplanation",
|
| + l10n_util::GetStringFUTF16(
|
| + IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL,
|
| + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
|
| + base::ASCIIToUTF16(
|
| + google_util::AppendGoogleLocaleParam(
|
| + GURL(chrome::kSyncGoogleDashboardURL),
|
| + g_browser_process->GetApplicationLocale()).spec())));
|
| + localized_strings->SetString("deleteProfileLabel",
|
| + l10n_util::GetStringUTF16(IDS_SYNC_STOP_DELETE_PROFILE_LABEL));
|
| + localized_strings->SetString("stopSyncingTitle",
|
| + l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_DIALOG_TITLE));
|
| + localized_strings->SetString("stopSyncingConfirm",
|
| + l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL));
|
| +
|
| + localized_strings->SetString(
|
| + "syncEverythingHelpURL", chrome::kSyncEverythingLearnMoreURL);
|
| + localized_strings->SetString(
|
| + "syncErrorHelpURL", chrome::kSyncErrorsHelpURL);
|
| +
|
| + static OptionsStringResource resources[] = {
|
| + { "syncSetupConfigureTitle", IDS_SYNC_SETUP_CONFIGURE_TITLE },
|
| + { "syncSetupSpinnerTitle", IDS_SYNC_SETUP_SPINNER_TITLE },
|
| + { "syncSetupTimeoutTitle", IDS_SYNC_SETUP_TIME_OUT_TITLE },
|
| + { "syncSetupTimeoutContent", IDS_SYNC_SETUP_TIME_OUT_CONTENT },
|
| + { "errorLearnMore", IDS_LEARN_MORE },
|
| + { "cancel", IDS_CANCEL },
|
| + { "loginSuccess", IDS_SYNC_SUCCESS },
|
| + { "settingUp", IDS_SYNC_LOGIN_SETTING_UP },
|
| + { "syncAllDataTypes", IDS_SYNC_EVERYTHING },
|
| + { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES },
|
| + { "syncNothing", IDS_SYNC_NOTHING },
|
| + { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS },
|
| + { "preferences", IDS_SYNC_DATATYPE_PREFERENCES },
|
| + { "autofill", IDS_SYNC_DATATYPE_AUTOFILL },
|
| + { "themes", IDS_SYNC_DATATYPE_THEMES },
|
| + { "passwords", IDS_SYNC_DATATYPE_PASSWORDS },
|
| + { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS },
|
| + { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS },
|
| + { "apps", IDS_SYNC_DATATYPE_APPS },
|
| + { "wifiCredentials", IDS_SYNC_DATATYPE_WIFI_CREDENTIALS },
|
| + { "openTabs", IDS_SYNC_DATATYPE_TABS },
|
| + { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR },
|
| + { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL },
|
| + { "emptyErrorMessage", IDS_SYNC_EMPTY_PASSPHRASE_ERROR },
|
| + { "mismatchErrorMessage", IDS_SYNC_PASSPHRASE_MISMATCH_ERROR },
|
| + { "customizeLinkLabel", IDS_SYNC_CUSTOMIZE_LINK_LABEL },
|
| + { "confirmSyncPreferences", IDS_SYNC_CONFIRM_SYNC_PREFERENCES },
|
| + { "syncEverything", IDS_SYNC_SYNC_EVERYTHING },
|
| + { "useDefaultSettings", IDS_SYNC_USE_DEFAULT_SETTINGS },
|
| + { "enterPassphraseBody", IDS_SYNC_ENTER_PASSPHRASE_BODY },
|
| + { "enterGooglePassphraseBody", IDS_SYNC_ENTER_GOOGLE_PASSPHRASE_BODY },
|
| + { "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL },
|
| + { "incorrectPassphrase", IDS_SYNC_INCORRECT_PASSPHRASE },
|
| + { "passphraseWarning", IDS_SYNC_PASSPHRASE_WARNING },
|
| + { "yes", IDS_SYNC_PASSPHRASE_CANCEL_YES },
|
| + { "no", IDS_SYNC_PASSPHRASE_CANCEL_NO },
|
| + { "sectionExplicitMessagePrefix", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_PREFIX },
|
| + { "sectionExplicitMessagePostfix",
|
| + IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_POSTFIX },
|
| + // TODO(rogerta): browser/resource/sync_promo/sync_promo.html and related
|
| + // file may not be needed any more. If not, then the following promo
|
| + // strings can also be removed.
|
| + { "promoPageTitle", IDS_SYNC_PROMO_TAB_TITLE },
|
| + { "promoSkipButton", IDS_SYNC_PROMO_SKIP_BUTTON },
|
| + { "promoAdvanced", IDS_SYNC_PROMO_ADVANCED },
|
| + { "promoLearnMore", IDS_LEARN_MORE },
|
| + { "promoTitleShort", IDS_SYNC_PROMO_MESSAGE_TITLE_SHORT },
|
| + { "encryptionSectionTitle", IDS_SYNC_ENCRYPTION_SECTION_TITLE },
|
| + { "basicEncryptionOption", IDS_SYNC_BASIC_ENCRYPTION_DATA },
|
| + { "fullEncryptionOption", IDS_SYNC_FULL_ENCRYPTION_DATA },
|
| + };
|
| +
|
| + RegisterStrings(localized_strings, resources, arraysize(resources));
|
| + RegisterTitle(localized_strings, "syncSetupOverlay", IDS_SYNC_SETUP_TITLE);
|
| +}
|
| +
|
| +void SyncOptionsHandler::RegisterMessages() {
|
| + sync_setup_handler_.RegisterMessages();
|
| +}
|
|
|