| 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 var AddLanguageOverlay = options.AddLanguageOverlay; | 5 var AddLanguageOverlay = options.AddLanguageOverlay; |
| 6 var AdvancedOptions = options.AdvancedOptions; | 6 var AdvancedOptions = options.AdvancedOptions; |
| 7 var AlertOverlay = options.AlertOverlay; | 7 var AlertOverlay = options.AlertOverlay; |
| 8 var AutofillEditAddressOverlay = options.AutofillEditAddressOverlay; | 8 var AutofillEditAddressOverlay = options.AutofillEditAddressOverlay; |
| 9 var AutofillEditCreditCardOverlay = options.AutofillEditCreditCardOverlay; | 9 var AutofillEditCreditCardOverlay = options.AutofillEditCreditCardOverlay; |
| 10 var AutofillOptions = options.AutofillOptions; | 10 var AutofillOptions = options.AutofillOptions; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // Proxy page is now per network and only reachable from internet details. | 226 // Proxy page is now per network and only reachable from internet details. |
| 227 if (pageName != 'proxy') { | 227 if (pageName != 'proxy') { |
| 228 // Show page, but don't update history (there's already an entry for it). | 228 // Show page, but don't update history (there's already an entry for it). |
| 229 OptionsPage.showPageByName(pageName, false); | 229 OptionsPage.showPageByName(pageName, false); |
| 230 } | 230 } |
| 231 } else { | 231 } else { |
| 232 OptionsPage.showDefaultPage(); | 232 OptionsPage.showDefaultPage(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); | 235 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); |
| 236 for(var i = 0; i < subpagesNavTabs.length; i++) { | 236 for (var i = 0; i < subpagesNavTabs.length; i++) { |
| 237 subpagesNavTabs[i].onclick = function(event) { | 237 subpagesNavTabs[i].onclick = function(event) { |
| 238 OptionsPage.showTab(event.srcElement); | 238 OptionsPage.showTab(event.srcElement); |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 // Allow platform specific CSS rules. | 242 // Allow platform specific CSS rules. |
| 243 cr.enablePlatformSpecificCSSRules(); | 243 cr.enablePlatformSpecificCSSRules(); |
| 244 | 244 |
| 245 if (navigator.plugins['Shockwave Flash']) | 245 if (navigator.plugins['Shockwave Flash']) |
| 246 document.documentElement.setAttribute('hasFlashPlugin', ''); | 246 document.documentElement.setAttribute('hasFlashPlugin', ''); |
| 247 } | 247 } |
| 248 | 248 |
| 249 document.addEventListener('DOMContentLoaded', load); | 249 document.addEventListener('DOMContentLoaded', load); |
| 250 | 250 |
| 251 /** |
| 252 * Listener for the |beforeunload| event. |
| 253 */ |
| 251 window.onbeforeunload = function() { | 254 window.onbeforeunload = function() { |
| 252 options.OptionsPage.willClose(); | 255 options.OptionsPage.willClose(); |
| 253 }; | 256 }; |
| 254 | 257 |
| 258 /** |
| 259 * Listener for the |popstate| event. |
| 260 * @param {Event} e The |popstate| event. |
| 261 */ |
| 255 window.onpopstate = function(e) { | 262 window.onpopstate = function(e) { |
| 256 options.OptionsPage.setState(e.state); | 263 options.OptionsPage.setState(e.state); |
| 257 }; | 264 }; |
| OLD | NEW |