Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1202)

Side by Side Diff: chrome/browser/dom_ui/options/advanced_options_handler.cc

Issue 6017002: DOMUI Settings: UTH: Remove the 'Reset to Defaults' button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 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/dom_ui/options/advanced_options_handler.h" 5 #include "chrome/browser/dom_ui/options/advanced_options_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 IDS_OPTIONS_CLOUD_PRINT_PROXY_ENABLED_MANAGE_BUTTON)); 166 IDS_OPTIONS_CLOUD_PRINT_PROXY_ENABLED_MANAGE_BUTTON));
167 localized_strings->SetString("cloudPrintProxyEnablingButton", 167 localized_strings->SetString("cloudPrintProxyEnablingButton",
168 l10n_util::GetStringUTF16(IDS_OPTIONS_CLOUD_PRINT_PROXY_ENABLING_BUTTON)); 168 l10n_util::GetStringUTF16(IDS_OPTIONS_CLOUD_PRINT_PROXY_ENABLING_BUTTON));
169 #endif 169 #endif
170 localized_strings->SetString("enableLogging", 170 localized_strings->SetString("enableLogging",
171 l10n_util::GetStringUTF16(IDS_OPTIONS_ENABLE_LOGGING)); 171 l10n_util::GetStringUTF16(IDS_OPTIONS_ENABLE_LOGGING));
172 localized_strings->SetString("improveBrowsingExperience", 172 localized_strings->SetString("improveBrowsingExperience",
173 l10n_util::GetStringUTF16(IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE)); 173 l10n_util::GetStringUTF16(IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE));
174 localized_strings->SetString("disableWebServices", 174 localized_strings->SetString("disableWebServices",
175 l10n_util::GetStringUTF16(IDS_OPTIONS_DISABLE_WEB_SERVICES)); 175 l10n_util::GetStringUTF16(IDS_OPTIONS_DISABLE_WEB_SERVICES));
176 localized_strings->SetString("optionsReset",
177 l10n_util::GetStringUTF16(IDS_OPTIONS_RESET));
178 localized_strings->SetString("optionsResetMessage",
179 l10n_util::GetStringUTF16(IDS_OPTIONS_RESET_MESSAGE));
180 localized_strings->SetString("optionsResetOkLabel",
181 l10n_util::GetStringUTF16(IDS_OPTIONS_RESET_OKLABEL));
182 localized_strings->SetString("optionsResetCancelLabel",
183 l10n_util::GetStringUTF16(IDS_OPTIONS_RESET_CANCELLABEL));
184 } 176 }
185 177
186 void AdvancedOptionsHandler::Initialize() { 178 void AdvancedOptionsHandler::Initialize() {
187 DCHECK(dom_ui_); 179 DCHECK(dom_ui_);
188 SetupMetricsReportingCheckbox(); 180 SetupMetricsReportingCheckbox();
189 SetupMetricsReportingSettingVisibility(); 181 SetupMetricsReportingSettingVisibility();
190 SetupDefaultZoomLevel(); 182 SetupDefaultZoomLevel();
191 SetupDownloadLocationPath(); 183 SetupDownloadLocationPath();
192 SetupAutoOpenFileTypesDisabledAttribute(); 184 SetupAutoOpenFileTypesDisabledAttribute();
193 SetupProxySettingsSection(); 185 SetupProxySettingsSection();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 224
233 void AdvancedOptionsHandler::RegisterMessages() { 225 void AdvancedOptionsHandler::RegisterMessages() {
234 // Setup handlers specific to this panel. 226 // Setup handlers specific to this panel.
235 DCHECK(dom_ui_); 227 DCHECK(dom_ui_);
236 dom_ui_->RegisterMessageCallback("selectDownloadLocation", 228 dom_ui_->RegisterMessageCallback("selectDownloadLocation",
237 NewCallback(this, 229 NewCallback(this,
238 &AdvancedOptionsHandler::HandleSelectDownloadLocation)); 230 &AdvancedOptionsHandler::HandleSelectDownloadLocation));
239 dom_ui_->RegisterMessageCallback("autoOpenFileTypesAction", 231 dom_ui_->RegisterMessageCallback("autoOpenFileTypesAction",
240 NewCallback(this, 232 NewCallback(this,
241 &AdvancedOptionsHandler::HandleAutoOpenButton)); 233 &AdvancedOptionsHandler::HandleAutoOpenButton));
242 dom_ui_->RegisterMessageCallback("resetToDefaults",
243 NewCallback(this,
244 &AdvancedOptionsHandler::HandleResetToDefaults));
245 dom_ui_->RegisterMessageCallback("defaultZoomLevelAction", 234 dom_ui_->RegisterMessageCallback("defaultZoomLevelAction",
246 NewCallback(this, &AdvancedOptionsHandler::HandleDefaultZoomLevel)); 235 NewCallback(this, &AdvancedOptionsHandler::HandleDefaultZoomLevel));
247 #if !defined(OS_CHROMEOS) 236 #if !defined(OS_CHROMEOS)
248 dom_ui_->RegisterMessageCallback("metricsReportingCheckboxAction", 237 dom_ui_->RegisterMessageCallback("metricsReportingCheckboxAction",
249 NewCallback(this, 238 NewCallback(this,
250 &AdvancedOptionsHandler::HandleMetricsReportingCheckbox)); 239 &AdvancedOptionsHandler::HandleMetricsReportingCheckbox));
251 #endif 240 #endif
252 #if !defined(USE_NSS) && !defined(USE_OPENSSL) 241 #if !defined(USE_NSS) && !defined(USE_OPENSSL)
253 dom_ui_->RegisterMessageCallback("showManageSSLCertificates", 242 dom_ui_->RegisterMessageCallback("showManageSSLCertificates",
254 NewCallback(this, 243 NewCallback(this,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 #endif 323 #endif
335 } 324 }
336 325
337 void AdvancedOptionsHandler::HandleAutoOpenButton(const ListValue* args) { 326 void AdvancedOptionsHandler::HandleAutoOpenButton(const ListValue* args) {
338 UserMetricsRecordAction(UserMetricsAction("Options_ResetAutoOpenFiles")); 327 UserMetricsRecordAction(UserMetricsAction("Options_ResetAutoOpenFiles"));
339 DownloadManager* manager = dom_ui_->GetProfile()->GetDownloadManager(); 328 DownloadManager* manager = dom_ui_->GetProfile()->GetDownloadManager();
340 if (manager) 329 if (manager)
341 manager->download_prefs()->ResetAutoOpen(); 330 manager->download_prefs()->ResetAutoOpen();
342 } 331 }
343 332
344 void AdvancedOptionsHandler::HandleResetToDefaults(const ListValue* args) {
345 OptionsUtil::ResetToDefaults(dom_ui_->GetProfile());
346 }
347
348 void AdvancedOptionsHandler::HandleMetricsReportingCheckbox( 333 void AdvancedOptionsHandler::HandleMetricsReportingCheckbox(
349 const ListValue* args) { 334 const ListValue* args) {
350 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) 335 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS)
351 std::string checked_str = WideToUTF8(ExtractStringValue(args)); 336 std::string checked_str = WideToUTF8(ExtractStringValue(args));
352 bool enabled = (checked_str == "true"); 337 bool enabled = (checked_str == "true");
353 UserMetricsRecordAction( 338 UserMetricsRecordAction(
354 enabled ? 339 enabled ?
355 UserMetricsAction("Options_MetricsReportingCheckbox_Enable") : 340 UserMetricsAction("Options_MetricsReportingCheckbox_Enable") :
356 UserMetricsAction("Options_MetricsReportingCheckbox_Disable")); 341 UserMetricsAction("Options_MetricsReportingCheckbox_Disable"));
357 bool is_enabled = OptionsUtil::ResolveMetricsReportingEnabled(enabled); 342 bool is_enabled = OptionsUtil::ResolveMetricsReportingEnabled(enabled);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 FundamentalValue useSSL3Value(useSSL3Setting); 557 FundamentalValue useSSL3Value(useSSL3Setting);
573 dom_ui_->CallJavascriptFunction( 558 dom_ui_->CallJavascriptFunction(
574 L"options.AdvancedOptions.SetUseSSL3CheckboxState", 559 L"options.AdvancedOptions.SetUseSSL3CheckboxState",
575 useSSL3Value, disabledValue); 560 useSSL3Value, disabledValue);
576 FundamentalValue useTLS1Value(useTLS1Setting); 561 FundamentalValue useTLS1Value(useTLS1Setting);
577 dom_ui_->CallJavascriptFunction( 562 dom_ui_->CallJavascriptFunction(
578 L"options.AdvancedOptions.SetUseTLS1CheckboxState", 563 L"options.AdvancedOptions.SetUseTLS1CheckboxState",
579 useTLS1Value, disabledValue); 564 useTLS1Value, disabledValue);
580 } 565 }
581 #endif 566 #endif
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/options/advanced_options_handler.h ('k') | chrome/browser/resources/options/advanced_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698