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

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 288923004: Add an extension override bubble and warning box for proxy extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('options', function() { 5 cr.define('options', function() {
6 var OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 var ArrayDataModel = cr.ui.ArrayDataModel; 7 var ArrayDataModel = cr.ui.ArrayDataModel;
8 var RepeatingButton = cr.ui.RepeatingButton; 8 var RepeatingButton = cr.ui.RepeatingButton;
9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; 9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator;
10 10
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 true); 563 true);
564 this.addExtensionControlledBox_('extension-controlled-container', 564 this.addExtensionControlledBox_('extension-controlled-container',
565 'homepage-controlled', 565 'homepage-controlled',
566 true); 566 true);
567 this.addExtensionControlledBox_('startup-section-content', 567 this.addExtensionControlledBox_('startup-section-content',
568 'startpage-controlled', 568 'startpage-controlled',
569 false); 569 false);
570 this.addExtensionControlledBox_('newtab-section-content', 570 this.addExtensionControlledBox_('newtab-section-content',
571 'newtab-controlled', 571 'newtab-controlled',
572 false); 572 false);
573 this.addExtensionControlledBox_('proxy-section-content',
574 'proxy-controlled',
575 true);
573 576
574 document.body.addEventListener('click', function(e) { 577 document.body.addEventListener('click', function(e) {
575 var button = findAncestor(e.target, function(el) { 578 var button = findAncestor(e.target, function(el) {
576 return el.tagName == 'BUTTON' && 579 return el.tagName == 'BUTTON' &&
577 el.dataset.extensionId !== undefined && 580 el.dataset.extensionId !== undefined &&
578 el.dataset.extensionId.length; 581 el.dataset.extensionId.length;
579 }); 582 });
580 if (button) 583 if (button)
581 chrome.send('disableExtension', [button.dataset.extensionId]); 584 chrome.send('disableExtension', [button.dataset.extensionId]);
582 }); 585 });
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 $('auto-open-file-types-container')); 1497 $('auto-open-file-types-container'));
1495 } else { 1498 } else {
1496 this.hideSectionWithAnimation_( 1499 this.hideSectionWithAnimation_(
1497 $('auto-open-file-types-section'), 1500 $('auto-open-file-types-section'),
1498 $('auto-open-file-types-container')); 1501 $('auto-open-file-types-container'));
1499 } 1502 }
1500 } 1503 }
1501 }, 1504 },
1502 1505
1503 /** 1506 /**
1504 * Set the enabled state for the proxy settings button. 1507 * Set the enabled state for the proxy settings button.
Dan Beam 2014/05/20 16:46:41 can you update this to say "proxy settings section
Dan Beam 2014/05/20 16:46:41 nit: can you document these params? e.g. * @par
Finnur 2014/05/21 16:30:32 So... there's a proxy button way down on the page
1505 * @private 1508 * @private
1506 */ 1509 */
1507 setupProxySettingsSection_: function(disabled, extensionControlled) { 1510 setupProxySettingsSection_: function(disabled, extensionControlled) {
1508 if (!cr.isChromeOS) { 1511 if (!cr.isChromeOS) {
1509 $('proxiesConfigureButton').disabled = disabled; 1512 $('proxiesConfigureButton').disabled = disabled;
1510 $('proxiesLabel').textContent = 1513 $('proxiesLabel').hidden = extensionControlled;
1511 loadTimeData.getString(extensionControlled ?
1512 'proxiesLabelExtension' : 'proxiesLabelSystem');
1513 } 1514 }
1514 }, 1515 },
1515 1516
1516 /** 1517 /**
1517 * Set the initial state of the spoken feedback checkbox. 1518 * Set the initial state of the spoken feedback checkbox.
1518 * @private 1519 * @private
1519 */ 1520 */
1520 setSpokenFeedbackCheckboxState_: function(checked) { 1521 setSpokenFeedbackCheckboxState_: function(checked) {
1521 $('accessibility-spoken-feedback-check').checked = checked; 1522 $('accessibility-spoken-feedback-check').checked = checked;
1522 }, 1523 },
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 details.homePage.id, 1613 details.homePage.id,
1613 details.homePage.name); 1614 details.homePage.name);
1614 this.toggleExtensionControlledBox_('startup-section-content', 1615 this.toggleExtensionControlledBox_('startup-section-content',
1615 'startpage-controlled', 1616 'startpage-controlled',
1616 details.startUpPage.id, 1617 details.startUpPage.id,
1617 details.startUpPage.name); 1618 details.startUpPage.name);
1618 this.toggleExtensionControlledBox_('newtab-section-content', 1619 this.toggleExtensionControlledBox_('newtab-section-content',
1619 'newtab-controlled', 1620 'newtab-controlled',
1620 details.newTabPage.id, 1621 details.newTabPage.id,
1621 details.newTabPage.name); 1622 details.newTabPage.name);
1623 this.toggleExtensionControlledBox_('proxy-section-content',
1624 'proxy-controlled',
1625 details.proxy.id,
1626 details.proxy.name);
1627
1628 // The proxy section contains just the warning box and nothing else, so
1629 // if we're hiding the proxy warning box, we should also hide its header
1630 // section.
1631 $('proxy-section').hidden = details.proxy.id.length == 0;
1622 }, 1632 },
1623 1633
1624 1634
1625 /** 1635 /**
1626 * Show/hide touchpad-related settings. 1636 * Show/hide touchpad-related settings.
1627 * @private 1637 * @private
1628 */ 1638 */
1629 showTouchpadControls_: function(show) { 1639 showTouchpadControls_: function(show) {
1630 $('touchpad-settings').hidden = !show; 1640 $('touchpad-settings').hidden = !show;
1631 $('accessibility-tap-dragging').hidden = !show; 1641 $('accessibility-tap-dragging').hidden = !show;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 BrowserOptions.getLoggedInUsername = function() { 1832 BrowserOptions.getLoggedInUsername = function() {
1823 return BrowserOptions.getInstance().username_; 1833 return BrowserOptions.getInstance().username_;
1824 }; 1834 };
1825 } 1835 }
1826 1836
1827 // Export 1837 // Export
1828 return { 1838 return {
1829 BrowserOptions: BrowserOptions 1839 BrowserOptions: BrowserOptions
1830 }; 1840 };
1831 }); 1841 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698