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

Unified Diff: chrome/browser/resources/options/advanced_options.js

Issue 9814030: get rid of old options pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/advanced_options.js
diff --git a/chrome/browser/resources/options/advanced_options.js b/chrome/browser/resources/options/advanced_options.js
deleted file mode 100644
index e9d4c93d5018f932f5e0aa6e6f15b1275b08be42..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/options/advanced_options.js
+++ /dev/null
@@ -1,276 +0,0 @@
-// Copyright (c) 2012 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.
-
-cr.define('options', function() {
-
-var OptionsPage = options.OptionsPage;
-
- //
- // AdvancedOptions class
- // Encapsulated handling of advanced options page.
- //
- function AdvancedOptions() {
- OptionsPage.call(this, 'advanced', templateData.advancedPageTabTitle,
- 'advancedPage');
- }
-
- cr.addSingletonGetter(AdvancedOptions);
-
- AdvancedOptions.prototype = {
- // Inherit AdvancedOptions from OptionsPage.
- __proto__: options.OptionsPage.prototype,
-
- /**
- * Initializes the page.
- */
- initializePage: function() {
- // Call base class implementation to starts preference initialization.
- OptionsPage.prototype.initializePage.call(this);
-
- // Set up click handlers for buttons.
- $('privacyContentSettingsButton').onclick = function(event) {
- OptionsPage.navigateToPage('content');
- OptionsPage.showTab($('cookies-nav-tab'));
- chrome.send('coreOptionsUserMetricsAction',
- ['Options_ContentSettings']);
- };
- $('privacyClearDataButton').onclick = function(event) {
- OptionsPage.navigateToPage('clearBrowserData');
- chrome.send('coreOptionsUserMetricsAction', ['Options_ClearData']);
- };
-
- // 'metricsReportingEnabled' element is only present on Chrome branded
- // builds.
- if ($('metricsReportingEnabled')) {
- $('metricsReportingEnabled').onclick = function(event) {
- chrome.send('metricsReportingCheckboxAction',
- [String(event.target.checked)]);
- };
- }
-
- if (!cr.isChromeOS) {
- $('autoOpenFileTypesResetToDefault').onclick = function(event) {
- chrome.send('autoOpenFileTypesAction');
- };
- }
-
- $('fontSettingsCustomizeFontsButton').onclick = function(event) {
- OptionsPage.navigateToPage('fonts');
- chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']);
- };
- $('defaultFontSize').onchange = function(event) {
- var value = event.target.options[event.target.selectedIndex].value;
- Preferences.setIntegerPref(
- 'webkit.webprefs.global.default_fixed_font_size',
- value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, '');
- chrome.send('defaultFontSizeAction', [String(value)]);
- };
- $('defaultZoomFactor').onchange = function(event) {
- chrome.send('defaultZoomFactorAction',
- [String(event.target.options[event.target.selectedIndex].value)]);
- };
-
- $('language-button').onclick = function(event) {
- OptionsPage.navigateToPage('languages');
- chrome.send('coreOptionsUserMetricsAction',
- ['Options_LanuageAndSpellCheckSettings']);
- };
-
- if (cr.isWindows || cr.isMac) {
- $('certificatesManageButton').onclick = function(event) {
- chrome.send('showManageSSLCertificates');
- };
- } else {
- $('certificatesManageButton').onclick = function(event) {
- OptionsPage.navigateToPage('certificates');
- chrome.send('coreOptionsUserMetricsAction',
- ['Options_ManageSSLCertificates']);
- };
- }
-
- if (!cr.isChromeOS) {
- $('proxiesConfigureButton').onclick = function(event) {
- chrome.send('showNetworkProxySettings');
- };
- $('downloadLocationChangeButton').onclick = function(event) {
- chrome.send('selectDownloadLocation');
- };
- // This text field is always disabled. Setting ".disabled = true" isn't
- // enough, since a policy can disable it but shouldn't re-enable when
- // it is removed.
- $('downloadLocationPath').setDisabled('readonly', true);
- }
-
- $('sslCheckRevocation').onclick = function(event) {
- chrome.send('checkRevocationCheckboxAction',
- [String($('sslCheckRevocation').checked)]);
- };
-
- if ($('backgroundModeCheckbox')) {
- cr.defineProperty($('backgroundModeCheckbox'),
- 'controlledBy',
- cr.PropertyKind.ATTR);
- $('backgroundModeCheckbox').onclick = function(event) {
- chrome.send('backgroundModeAction',
- [String($('backgroundModeCheckbox').checked)]);
- };
- }
-
- // 'cloudPrintProxyEnabled' is true for Chrome branded builds on
- // certain platforms, or could be enabled by a lab.
- if (!cr.isChromeOS) {
- $('cloudPrintConnectorSetupButton').onclick = function(event) {
- if ($('cloudPrintManageButton').style.display == 'none') {
- // Disable the button, set it's text to the intermediate state.
- $('cloudPrintConnectorSetupButton').textContent =
- localStrings.getString('cloudPrintConnectorEnablingButton');
- $('cloudPrintConnectorSetupButton').disabled = true;
- chrome.send('showCloudPrintSetupDialog');
- } else {
- chrome.send('disableCloudPrintConnector');
- }
- };
- }
- $('cloudPrintManageButton').onclick = function(event) {
- chrome.send('showCloudPrintManagePage');
- };
-
- }
- };
-
- //
- // Chrome callbacks
- //
-
- // Set the checked state of the metrics reporting checkbox.
- AdvancedOptions.SetMetricsReportingCheckboxState = function(
- checked, disabled) {
- $('metricsReportingEnabled').checked = checked;
- $('metricsReportingEnabled').disabled = disabled;
- if (disabled)
- $('metricsReportingEnabledText').className = 'disable-services-span';
- }
-
- AdvancedOptions.SetMetricsReportingSettingVisibility = function(visible) {
- if (visible) {
- $('metricsReportingSetting').style.display = 'block';
- } else {
- $('metricsReportingSetting').style.display = 'none';
- }
- }
-
- // Set the font size selected item.
- AdvancedOptions.SetFontSize = function(font_size_value) {
- var selectCtl = $('defaultFontSize');
- for (var i = 0; i < selectCtl.options.length; i++) {
- if (selectCtl.options[i].value == font_size_value) {
- selectCtl.selectedIndex = i;
- if ($('Custom'))
- selectCtl.remove($('Custom').index);
- return;
- }
- }
-
- // Add/Select Custom Option in the font size label list.
- if (!$('Custom')) {
- var option = new Option(localStrings.getString('fontSizeLabelCustom'),
- -1, false, true);
- option.setAttribute("id", "Custom");
- selectCtl.add(option);
- }
- $('Custom').selected = true;
- };
-
- /**
- * Populate the page zoom selector with values received from the caller.
- * @param {Array} items An array of items to populate the selector.
- * each object is an array with three elements as follows:
- * 0: The title of the item (string).
- * 1: The value of the item (number).
- * 2: Whether the item should be selected (boolean).
- */
- AdvancedOptions.SetupPageZoomSelector = function(items) {
- var element = $('defaultZoomFactor');
-
- // Remove any existing content.
- element.textContent = '';
-
- // Insert new child nodes into select element.
- var value, title, selected;
- for (var i = 0; i < items.length; i++) {
- title = items[i][0];
- value = items[i][1];
- selected = items[i][2];
- element.appendChild(new Option(title, value, false, selected));
- }
- };
-
- // Set the enabled state for the autoOpenFileTypesResetToDefault button.
- AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) {
- if (!cr.isChromeOS) {
- $('autoOpenFileTypesResetToDefault').disabled = disabled;
-
- if (disabled)
- $('auto-open-file-types-label').classList.add('disabled');
- else
- $('auto-open-file-types-label').classList.remove('disabled');
- }
- };
-
- // Set the enabled state for the proxy settings button.
- AdvancedOptions.SetupProxySettingsSection = function(disabled, label) {
- if (!cr.isChromeOS) {
- $('proxiesConfigureButton').disabled = disabled;
- $('proxiesLabel').textContent = label;
- }
- };
-
- // Set the checked state for the sslCheckRevocation checkbox.
- AdvancedOptions.SetCheckRevocationCheckboxState = function(
- checked, disabled) {
- $('sslCheckRevocation').checked = checked;
- $('sslCheckRevocation').disabled = disabled;
- };
-
- // Set the checked state for the backgroundModeCheckbox element.
- AdvancedOptions.SetBackgroundModeCheckboxState = function(
- checked, disabled, controlled_by) {
- $('backgroundModeCheckbox').checked = checked;
- $('backgroundModeCheckbox').disabled = disabled;
- $('backgroundModeCheckbox').controlledBy = controlled_by;
- OptionsPage.updateManagedBannerVisibility();
- };
-
- // Set the Cloud Print proxy UI to enabled, disabled, or processing.
- AdvancedOptions.SetupCloudPrintConnectorSection = function(
- disabled, label, allowed) {
- if (!cr.isChromeOS) {
- $('cloudPrintConnectorLabel').textContent = label;
- if (disabled || !allowed) {
- $('cloudPrintConnectorSetupButton').textContent =
- localStrings.getString('cloudPrintConnectorDisabledButton');
- $('cloudPrintManageButton').style.display = 'none';
- } else {
- $('cloudPrintConnectorSetupButton').textContent =
- localStrings.getString('cloudPrintConnectorEnabledButton');
- $('cloudPrintManageButton').style.display = 'inline';
- }
- $('cloudPrintConnectorSetupButton').disabled = !allowed;
- }
- };
-
- AdvancedOptions.RemoveCloudPrintConnectorSection = function() {
- if (!cr.isChromeOS) {
- var connectorSectionElm = $('cloud-print-connector-section');
- if (connectorSectionElm)
- connectorSectionElm.parentNode.removeChild(connectorSectionElm);
- }
- };
-
- // Export
- return {
- AdvancedOptions: AdvancedOptions
- };
-
-});

Powered by Google App Engine
This is Rietveld 408576698