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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 | 76 |
77 if (cr.isChromeOS) | 77 if (cr.isChromeOS) |
78 UIAccountTweaks.applyGuestModeVisibility(document); | 78 UIAccountTweaks.applyGuestModeVisibility(document); |
79 | 79 |
80 // Cookies filter page --------------------------------------------------- | 80 // Cookies filter page --------------------------------------------------- |
81 $('show-cookies-button').onclick = function(event) { | 81 $('show-cookies-button').onclick = function(event) { |
82 chrome.send('coreOptionsUserMetricsAction', ['Options_ShowCookies']); | 82 chrome.send('coreOptionsUserMetricsAction', ['Options_ShowCookies']); |
83 OptionsPage.navigateToPage('cookies'); | 83 OptionsPage.navigateToPage('cookies'); |
84 }; | 84 }; |
85 | 85 |
86 // Remove from DOM instead of hiding so :last-of-type applies the style | |
87 // correctly. | |
88 var intentsSection = $('intents-section'); | 86 var intentsSection = $('intents-section'); |
89 if (!loadTimeData.getBoolean('enable_web_intents') && intentsSection) | 87 if (!loadTimeData.getBoolean('enable_web_intents') && intentsSection) |
90 intentsSection.parentNode.removeChild(intentsSection); | 88 intentsSection.parentNode.removeChild(intentsSection); |
91 | 89 |
92 if (loadTimeData.getBoolean('enable_restore_session_state')) { | 90 if (loadTimeData.getBoolean('enable_restore_session_state')) { |
93 this.sessionRestoreEnabled = true; | 91 this.sessionRestoreEnabled = true; |
94 this.updateSessionRestoreContentSettings(); | 92 this.updateSessionRestoreContentSettings(); |
95 } | 93 } |
96 | 94 |
97 $('content-settings-overlay-confirm').onclick = | 95 $('content-settings-overlay-confirm').onclick = |
98 OptionsPage.closeOverlay.bind(OptionsPage); | 96 OptionsPage.closeOverlay.bind(OptionsPage); |
97 | |
98 $('pepper-flash-cameramic-section').style.display = 'none'; | |
99 $('pepper-flash-cameramic-exceptions-div').style.display = 'none'; | |
csilv
2012/06/05 00:40:21
$('pepper-flash-cameramic-section').hidden = true;
yzshen1
2012/06/05 17:28:43
I tried hidden before.
It worked with the section,
csilv
2012/06/05 18:09:27
That's okay, I'm fine with not using hidden for th
| |
99 }, | 100 }, |
100 | 101 |
101 /** | 102 /** |
102 * Called when the value of the "On startup" setting changes. | 103 * Called when the value of the "On startup" setting changes. |
103 * @param {Event} event Change event. | 104 * @param {Event} event Change event. |
104 * @private | 105 * @private |
105 */ | 106 */ |
106 onSessionRestoreSelectedChanged: function(event) { | 107 onSessionRestoreSelectedChanged: function(event) { |
107 if (!event.value || typeof event.value['value'] == 'undefined') | 108 if (!event.value || typeof event.value['value'] == 'undefined') |
108 return; | 109 return; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 * a content exception setting. | 218 * a content exception setting. |
218 */ | 219 */ |
219 ContentSettings.patternValidityCheckComplete = | 220 ContentSettings.patternValidityCheckComplete = |
220 function(type, mode, pattern, valid) { | 221 function(type, mode, pattern, valid) { |
221 var exceptionsList = | 222 var exceptionsList = |
222 document.querySelector('div[contentType=' + type + '] ' + | 223 document.querySelector('div[contentType=' + type + '] ' + |
223 'list[mode=' + mode + ']'); | 224 'list[mode=' + mode + ']'); |
224 exceptionsList.patternValidityCheckComplete(pattern, valid); | 225 exceptionsList.patternValidityCheckComplete(pattern, valid); |
225 }; | 226 }; |
226 | 227 |
228 /** | |
229 * Enables the Pepper Flash camera and microphone settings. | |
230 * Please note that whether the settings are actually showed or not is also | |
231 * affected by the style class pepper-flash-settings. | |
232 */ | |
233 ContentSettings.enablePepperFlashCameraMicSettings = function() { | |
234 $('pepper-flash-cameramic-section').style.display = ''; | |
235 $('pepper-flash-cameramic-exceptions-div').style.display = ''; | |
csilv
2012/06/05 00:40:21
$('pepper-flash-cameramic-section').hidden = false
yzshen1
2012/06/05 17:28:43
Please see my comment above.
On 2012/06/05 00:40:
| |
236 } | |
237 | |
227 // Export | 238 // Export |
228 return { | 239 return { |
229 ContentSettings: ContentSettings | 240 ContentSettings: ContentSettings |
230 }; | 241 }; |
231 | 242 |
232 }); | 243 }); |
OLD | NEW |