OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/dom_ui/advanced_options_handler.h" |
| 6 |
| 7 #include "app/l10n_util.h" |
| 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" |
| 10 #include "base/values.h" |
| 11 #include "grit/chromium_strings.h" |
| 12 #include "grit/generated_resources.h" |
| 13 #include "grit/locale_settings.h" |
| 14 |
| 15 AdvancedOptionsHandler::AdvancedOptionsHandler() { |
| 16 } |
| 17 |
| 18 AdvancedOptionsHandler::~AdvancedOptionsHandler() { |
| 19 } |
| 20 |
| 21 void AdvancedOptionsHandler::GetLocalizedValues( |
| 22 DictionaryValue* localized_strings) { |
| 23 DCHECK(localized_strings); |
| 24 |
| 25 localized_strings->SetString(L"privacyLearnMoreURL", |
| 26 l10n_util::GetString(IDS_LEARN_MORE_PRIVACY_URL)); |
| 27 localized_strings->SetString(L"privacyLearnMoreLabel", |
| 28 l10n_util::GetString(IDS_OPTIONS_LEARN_MORE_LABEL)); |
| 29 localized_strings->SetString(L"downloadLocationGroupName", |
| 30 l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_GROUP_NAME)); |
| 31 localized_strings->SetString(L"downloadLocationBrowseButton", |
| 32 l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_BUTTON)); |
| 33 localized_strings->SetString(L"downloadLocationBrowseTitle", |
| 34 l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE)); |
| 35 localized_strings->SetString(L"downloadLocationBrowseWindowTitle", |
| 36 l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_WINDOW_TITLE)); |
| 37 localized_strings->SetString(L"downloadLocationAskForSaveLocation", |
| 38 l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION)); |
| 39 localized_strings->SetString(L"autoOpenFileTypesInfo", |
| 40 l10n_util::GetString(IDS_OPTIONS_AUTOOPENFILETYPES_INFO)); |
| 41 localized_strings->SetString(L"autoOpenFileTypesResetToDefault", |
| 42 l10n_util::GetString(IDS_OPTIONS_AUTOOPENFILETYPES_RESETTODEFAULT)); |
| 43 localized_strings->SetString(L"gearSettingsGroupName", |
| 44 l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_GROUP_NAME)); |
| 45 localized_strings->SetString(L"gearSettingsConfigureGearsButton", |
| 46 l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_CONFIGUREGEARS_BUTTON)); |
| 47 localized_strings->SetString(L"translateEnableTranslate", |
| 48 l10n_util::GetString(IDS_OPTIONS_TRANSLATE_ENABLE_TRANSLATE)); |
| 49 localized_strings->SetString(L"certificatesLabel", |
| 50 l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_LABEL)); |
| 51 localized_strings->SetString(L"certificatesManageButton", |
| 52 l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_MANAGE_BUTTON)); |
| 53 localized_strings->SetString(L"proxiesLabel", |
| 54 l10n_util::GetString(IDS_OPTIONS_PROXIES_LABEL)); |
| 55 localized_strings->SetString(L"proxiesConfigureButton", |
| 56 l10n_util::GetString(IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON)); |
| 57 localized_strings->SetString(L"safeBrowsingEnableProtection", |
| 58 l10n_util::GetString(IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION)); |
| 59 localized_strings->SetString(L"sslGroupDescription", |
| 60 l10n_util::GetString(IDS_OPTIONS_SSL_GROUP_DESCRIPTION)); |
| 61 localized_strings->SetString(L"sslUseSsl2", |
| 62 l10n_util::GetString(IDS_OPTIONS_SSL_USESSL2)); |
| 63 localized_strings->SetString(L"sslCheckRevocation", |
| 64 l10n_util::GetString(IDS_OPTIONS_SSL_CHECKREVOCATION)); |
| 65 localized_strings->SetString(L"sslUseSsl3", |
| 66 l10n_util::GetString(IDS_OPTIONS_SSL_USESSL3)); |
| 67 localized_strings->SetString(L"sslUseTsl1", |
| 68 l10n_util::GetString(IDS_OPTIONS_SSL_USETLS1)); |
| 69 localized_strings->SetString(L"networkDNSPrefetchEnabledDescription", |
| 70 l10n_util::GetString(IDS_NETWORK_DNS_PREFETCH_ENABLED_DESCRIPTION)); |
| 71 localized_strings->SetString(L"privacyContentSettingsButton", |
| 72 l10n_util::GetString(IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON)); |
| 73 localized_strings->SetString(L"privacyClearDataButton", |
| 74 l10n_util::GetString(IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON)); |
| 75 localized_strings->SetString(L"linkDoctorPref", |
| 76 l10n_util::GetString(IDS_OPTIONS_LINKDOCTOR_PREF)); |
| 77 localized_strings->SetString(L"suggestPref", |
| 78 l10n_util::GetString(IDS_OPTIONS_SUGGEST_PREF)); |
| 79 localized_strings->SetString(L"tabsToLinksPref", |
| 80 l10n_util::GetString(IDS_OPTIONS_TABS_TO_LINKS_PREF)); |
| 81 localized_strings->SetString(L"fontSettingsInfo", |
| 82 l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_INFO)); |
| 83 localized_strings->SetString(L"fontSettingsConfigureFontsOnlyButton", |
| 84 l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_CONFIGUREFONTSONLY_BUTTON)); |
| 85 localized_strings->SetString(L"advancedSectionTitlePrivacy", |
| 86 l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY)); |
| 87 localized_strings->SetString(L"advancedSectionTitleContent", |
| 88 l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT)); |
| 89 localized_strings->SetString(L"advancedSectionTitleSecurity", |
| 90 l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY)); |
| 91 localized_strings->SetString(L"advancedSectionTitleNetwork", |
| 92 l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK)); |
| 93 localized_strings->SetString(L"advancedSectionTitleTranslate", |
| 94 l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_TRANSLATE)); |
| 95 localized_strings->SetString(L"translateEnableTranslate", |
| 96 l10n_util::GetString(IDS_OPTIONS_TRANSLATE_ENABLE_TRANSLATE)); |
| 97 localized_strings->SetString(L"enableLogging", |
| 98 l10n_util::GetString(IDS_OPTIONS_ENABLE_LOGGING)); |
| 99 localized_strings->SetString(L"disableServices", |
| 100 l10n_util::GetString(IDS_OPTIONS_DISABLE_SERVICES)); |
| 101 } |
| 102 |
| 103 void AdvancedOptionsHandler::RegisterMessages() { |
| 104 #if defined(OS_MACOSX) |
| 105 dom_ui_->RegisterMessageCallback("showNetworkProxySettings", |
| 106 NewCallback(this, |
| 107 &AdvancedOptionsHandler::ShowNetworkProxySettings)); |
| 108 dom_ui_->RegisterMessageCallback("showManageSSLCertificates", |
| 109 NewCallback(this, |
| 110 &AdvancedOptionsHandler::ShowManageSSLCertificates)); |
| 111 #endif |
| 112 } |
| 113 |
| 114 #if defined(OS_MACOSX) |
| 115 void AdvancedOptionsHandler::ShowNetworkProxySettings(const Value* value) { |
| 116 AdvancedOptionsUtilities::ShowNetworkProxySettings(); |
| 117 } |
| 118 |
| 119 void AdvancedOptionsHandler::ShowManageSSLCertificates(const Value* value) { |
| 120 AdvancedOptionsUtilities::ShowManageSSLCertificates(); |
| 121 } |
| 122 #endif |
| 123 |
OLD | NEW |