| OLD | NEW |
| 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 /** @const */ var OptionsPage = options.OptionsPage; | 6 /** @const */ var OptionsPage = options.OptionsPage; |
| 7 | 7 |
| 8 ////////////////////////////////////////////////////////////////////////////// | 8 ////////////////////////////////////////////////////////////////////////////// |
| 9 // ContentSettings class: | 9 // ContentSettings class: |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 if (cr.isChromeOS) | 80 if (cr.isChromeOS) |
| 81 UIAccountTweaks.applyGuestModeVisibility(document); | 81 UIAccountTweaks.applyGuestModeVisibility(document); |
| 82 | 82 |
| 83 // Cookies filter page --------------------------------------------------- | 83 // Cookies filter page --------------------------------------------------- |
| 84 $('show-cookies-button').onclick = function(event) { | 84 $('show-cookies-button').onclick = function(event) { |
| 85 chrome.send('coreOptionsUserMetricsAction', ['Options_ShowCookies']); | 85 chrome.send('coreOptionsUserMetricsAction', ['Options_ShowCookies']); |
| 86 OptionsPage.navigateToPage('cookies'); | 86 OptionsPage.navigateToPage('cookies'); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // Remove from DOM instead of hiding so :last-of-type applies the style | |
| 90 // correctly. | |
| 91 var intentsSection = $('intents-section'); | 89 var intentsSection = $('intents-section'); |
| 92 if (!loadTimeData.getBoolean('enable_web_intents') && intentsSection) | 90 if (!loadTimeData.getBoolean('enable_web_intents') && intentsSection) |
| 93 intentsSection.parentNode.removeChild(intentsSection); | 91 intentsSection.parentNode.removeChild(intentsSection); |
| 94 | 92 |
| 95 if (loadTimeData.getBoolean('enable_restore_session_state')) { | 93 if (loadTimeData.getBoolean('enable_restore_session_state')) { |
| 96 this.sessionRestoreEnabled = true; | 94 this.sessionRestoreEnabled = true; |
| 97 this.updateSessionRestoreContentSettings(); | 95 this.updateSessionRestoreContentSettings(); |
| 98 } | 96 } |
| 99 | 97 |
| 100 $('content-settings-overlay-confirm').onclick = | 98 $('content-settings-overlay-confirm').onclick = |
| 101 OptionsPage.closeOverlay.bind(OptionsPage); | 99 OptionsPage.closeOverlay.bind(OptionsPage); |
| 100 |
| 101 $('pepper-flash-cameramic-section').style.display = 'none'; |
| 102 $('pepper-flash-cameramic-exceptions-div').style.display = 'none'; |
| 102 }, | 103 }, |
| 103 | 104 |
| 104 /** | 105 /** |
| 105 * Called when the value of the "On startup" setting changes. | 106 * Called when the value of the "On startup" setting changes. |
| 106 * @param {Event} event Change event. | 107 * @param {Event} event Change event. |
| 107 * @private | 108 * @private |
| 108 */ | 109 */ |
| 109 onSessionRestoreSelectedChanged: function(event) { | 110 onSessionRestoreSelectedChanged: function(event) { |
| 110 if (!event.value || typeof event.value['value'] == 'undefined') | 111 if (!event.value || typeof event.value['value'] == 'undefined') |
| 111 return; | 112 return; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 * a content exception setting. | 221 * a content exception setting. |
| 221 */ | 222 */ |
| 222 ContentSettings.patternValidityCheckComplete = | 223 ContentSettings.patternValidityCheckComplete = |
| 223 function(type, mode, pattern, valid) { | 224 function(type, mode, pattern, valid) { |
| 224 var exceptionsList = | 225 var exceptionsList = |
| 225 document.querySelector('div[contentType=' + type + '] ' + | 226 document.querySelector('div[contentType=' + type + '] ' + |
| 226 'list[mode=' + mode + ']'); | 227 'list[mode=' + mode + ']'); |
| 227 exceptionsList.patternValidityCheckComplete(pattern, valid); | 228 exceptionsList.patternValidityCheckComplete(pattern, valid); |
| 228 }; | 229 }; |
| 229 | 230 |
| 231 /** |
| 232 * Enables the Pepper Flash camera and microphone settings. |
| 233 * Please note that whether the settings are actually showed or not is also |
| 234 * affected by the style class pepper-flash-settings. |
| 235 */ |
| 236 ContentSettings.enablePepperFlashCameraMicSettings = function() { |
| 237 $('pepper-flash-cameramic-section').style.display = ''; |
| 238 $('pepper-flash-cameramic-exceptions-div').style.display = ''; |
| 239 } |
| 240 |
| 230 // Export | 241 // Export |
| 231 return { | 242 return { |
| 232 ContentSettings: ContentSettings | 243 ContentSettings: ContentSettings |
| 233 }; | 244 }; |
| 234 | 245 |
| 235 }); | 246 }); |
| OLD | NEW |