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 FocusOutlineManager = cr.ui.FocusOutlineManager; | 6 /** @const */ var FocusOutlineManager = cr.ui.FocusOutlineManager; |
7 | 7 |
8 var OptionsPage = { | 8 var OptionsPage = { |
9 /** | 9 /** |
10 * This is the absolute difference maintained between standard and | 10 * This is the absolute difference maintained between standard and |
(...skipping 29 matching lines...) Expand all Loading... |
40 var tabBar = tab; | 40 var tabBar = tab; |
41 while (tabBar && tabBar.classList && | 41 while (tabBar && tabBar.classList && |
42 !tabBar.classList.contains('subpages-nav-tabs')) { | 42 !tabBar.classList.contains('subpages-nav-tabs')) { |
43 tabBar = tabBar.parentNode; | 43 tabBar = tabBar.parentNode; |
44 } | 44 } |
45 if (!tabBar || !tabBar.classList) | 45 if (!tabBar || !tabBar.classList) |
46 return; | 46 return; |
47 | 47 |
48 if (tabBar.activeNavTab != null) { | 48 if (tabBar.activeNavTab != null) { |
49 tabBar.activeNavTab.classList.remove('active-tab'); | 49 tabBar.activeNavTab.classList.remove('active-tab'); |
50 $(tabBar.activeNavTab.getAttribute('tab-contents')).classList. | 50 $(tabBar.activeNavTab.getAttribute('tab-contents')) |
51 remove('active-tab-contents'); | 51 .classList.remove('active-tab-contents'); |
52 } | 52 } |
53 | 53 |
54 tab.classList.add('active-tab'); | 54 tab.classList.add('active-tab'); |
55 $(tab.getAttribute('tab-contents')).classList.add('active-tab-contents'); | 55 $(tab.getAttribute('tab-contents')).classList.add('active-tab-contents'); |
56 tabBar.activeNavTab = tab; | 56 tabBar.activeNavTab = tab; |
57 }, | 57 }, |
58 | 58 |
59 /** | 59 /** |
60 * Shows or hides options for clearing Flash LSOs. | 60 * Shows or hides options for clearing Flash LSOs. |
61 * @param {boolean} enabled Whether plugin data can be cleared. | 61 * @param {boolean} enabled Whether plugin data can be cleared. |
62 */ | 62 */ |
63 setClearPluginLSODataEnabled: function(enabled) { | 63 setClearPluginLSODataEnabled: function(enabled) { |
64 if (enabled) { | 64 if (enabled) { |
65 document.documentElement.setAttribute( | 65 document.documentElement.setAttribute( |
66 'flashPluginSupportsClearSiteData', ''); | 66 'flashPluginSupportsClearSiteData', ''); |
67 } else { | 67 } else { |
68 document.documentElement.removeAttribute( | 68 document.documentElement.removeAttribute( |
69 'flashPluginSupportsClearSiteData'); | 69 'flashPluginSupportsClearSiteData'); |
70 } | 70 } |
71 if (navigator.plugins['Shockwave Flash']) | 71 if (navigator.plugins['Shockwave Flash']) |
72 document.documentElement.setAttribute('hasFlashPlugin', ''); | 72 document.documentElement.setAttribute('hasFlashPlugin', ''); |
73 }, | 73 }, |
74 | 74 |
75 /** | 75 /** |
76 * Shows or hides Pepper Flash settings. | 76 * Shows or hides Pepper Flash settings. |
77 * @param {boolean} enabled Whether Pepper Flash settings should be enabled. | 77 * @param {boolean} enabled Whether Pepper Flash settings should be enabled. |
78 */ | 78 */ |
79 setPepperFlashSettingsEnabled: function(enabled) { | 79 setPepperFlashSettingsEnabled: function(enabled) { |
80 if (enabled) { | 80 if (enabled) { |
81 document.documentElement.setAttribute( | 81 document.documentElement.setAttribute('enablePepperFlashSettings', ''); |
82 'enablePepperFlashSettings', ''); | |
83 } else { | 82 } else { |
84 document.documentElement.removeAttribute( | 83 document.documentElement.removeAttribute('enablePepperFlashSettings'); |
85 'enablePepperFlashSettings'); | |
86 } | 84 } |
87 }, | 85 }, |
88 }; | 86 }; |
89 | 87 |
90 // Export | 88 // Export |
91 return { | 89 return {OptionsPage: OptionsPage}; |
92 OptionsPage: OptionsPage | |
93 }; | |
94 }); | 90 }); |
OLD | NEW |