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. |
89 var intentsSection = $('intents-section'); | 91 var intentsSection = $('intents-section'); |
90 if (!loadTimeData.getBoolean('enable_web_intents') && intentsSection) | 92 if (!loadTimeData.getBoolean('enable_web_intents') && intentsSection) |
91 intentsSection.parentNode.removeChild(intentsSection); | 93 intentsSection.parentNode.removeChild(intentsSection); |
92 | 94 |
93 if (loadTimeData.getBoolean('enable_restore_session_state')) { | 95 if (loadTimeData.getBoolean('enable_restore_session_state')) { |
94 this.sessionRestoreEnabled = true; | 96 this.sessionRestoreEnabled = true; |
95 this.updateSessionRestoreContentSettings(); | 97 this.updateSessionRestoreContentSettings(); |
96 } | 98 } |
97 | 99 |
98 $('content-settings-overlay-confirm').onclick = | 100 $('content-settings-overlay-confirm').onclick = |
99 OptionsPage.closeOverlay.bind(OptionsPage); | 101 OptionsPage.closeOverlay.bind(OptionsPage); |
100 | |
101 $('pepper-flash-cameramic-section').style.display = 'none'; | |
102 $('pepper-flash-cameramic-exceptions-div').style.display = 'none'; | |
103 }, | 102 }, |
104 | 103 |
105 /** | 104 /** |
106 * Called when the value of the "On startup" setting changes. | 105 * Called when the value of the "On startup" setting changes. |
107 * @param {Event} event Change event. | 106 * @param {Event} event Change event. |
108 * @private | 107 * @private |
109 */ | 108 */ |
110 onSessionRestoreSelectedChanged: function(event) { | 109 onSessionRestoreSelectedChanged: function(event) { |
111 if (!event.value || typeof event.value['value'] == 'undefined') | 110 if (!event.value || typeof event.value['value'] == 'undefined') |
112 return; | 111 return; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 * a content exception setting. | 220 * a content exception setting. |
222 */ | 221 */ |
223 ContentSettings.patternValidityCheckComplete = | 222 ContentSettings.patternValidityCheckComplete = |
224 function(type, mode, pattern, valid) { | 223 function(type, mode, pattern, valid) { |
225 var exceptionsList = | 224 var exceptionsList = |
226 document.querySelector('div[contentType=' + type + '] ' + | 225 document.querySelector('div[contentType=' + type + '] ' + |
227 'list[mode=' + mode + ']'); | 226 'list[mode=' + mode + ']'); |
228 exceptionsList.patternValidityCheckComplete(pattern, valid); | 227 exceptionsList.patternValidityCheckComplete(pattern, valid); |
229 }; | 228 }; |
230 | 229 |
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 | |
241 // Export | 230 // Export |
242 return { | 231 return { |
243 ContentSettings: ContentSettings | 232 ContentSettings: ContentSettings |
244 }; | 233 }; |
245 | 234 |
246 }); | 235 }); |
OLD | NEW |