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 AlertOverlay = options.AlertOverlay; | 6 var AlertOverlay = options.AlertOverlay; |
7 var AutofillEditAddressOverlay = options.AutofillEditAddressOverlay; | 7 var AutofillEditAddressOverlay = options.AutofillEditAddressOverlay; |
8 var AutofillEditCreditCardOverlay = options.AutofillEditCreditCardOverlay; | 8 var AutofillEditCreditCardOverlay = options.AutofillEditCreditCardOverlay; |
9 var AutofillOptions = options.AutofillOptions; | 9 var AutofillOptions = options.AutofillOptions; |
10 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; | 10 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 CertificateManager.getInstance()); | 225 CertificateManager.getInstance()); |
226 } | 226 } |
227 | 227 |
228 cr.ui.FocusManager.disableMouseFocusOnButtons(); | 228 cr.ui.FocusManager.disableMouseFocusOnButtons(); |
229 OptionsFocusManager.getInstance().initialize(); | 229 OptionsFocusManager.getInstance().initialize(); |
230 Preferences.getInstance().initialize(); | 230 Preferences.getInstance().initialize(); |
231 AutomaticSettingsResetBanner.getInstance().initialize(); | 231 AutomaticSettingsResetBanner.getInstance().initialize(); |
232 OptionsPage.initialize(); | 232 OptionsPage.initialize(); |
233 PageManager.initialize(BrowserOptions.getInstance()); | 233 PageManager.initialize(BrowserOptions.getInstance()); |
234 PageManager.addObserver(new uber.PageManagerObserver()); | 234 PageManager.addObserver(new uber.PageManagerObserver()); |
| 235 uber.onContentFrameLoaded(); |
235 | 236 |
236 var pageName = PageManager.getPageNameFromPath(); | 237 var pageName = PageManager.getPageNameFromPath(); |
237 // Still update history so that chrome://settings/nonexistant redirects | 238 // Still update history so that chrome://settings/nonexistant redirects |
238 // appropriately to chrome://settings/. If the URL matches, updateHistory_ | 239 // appropriately to chrome://settings/. If the URL matches, updateHistory_ |
239 // will avoid the extra replaceState. | 240 // will avoid the extra replaceState. |
240 var updateHistory = true; | 241 var updateHistory = true; |
241 PageManager.showPageByName(pageName, updateHistory, {replaceState: true}); | 242 PageManager.showPageByName(pageName, updateHistory, {replaceState: true}); |
242 | 243 |
243 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); | 244 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); |
244 for (var i = 0; i < subpagesNavTabs.length; i++) { | 245 for (var i = 0; i < subpagesNavTabs.length; i++) { |
245 subpagesNavTabs[i].onclick = function(event) { | 246 subpagesNavTabs[i].onclick = function(event) { |
246 OptionsPage.showTab(event.srcElement); | 247 OptionsPage.showTab(event.srcElement); |
247 }; | 248 }; |
248 } | 249 } |
249 | 250 |
250 uber.onContentFrameLoaded(); | |
251 | |
252 window.setTimeout(function() { | 251 window.setTimeout(function() { |
253 document.documentElement.classList.remove('loading'); | 252 document.documentElement.classList.remove('loading'); |
254 chrome.send('onFinishedLoadingOptions'); | 253 chrome.send('onFinishedLoadingOptions'); |
255 }); | 254 }); |
256 } | 255 } |
257 | 256 |
258 document.documentElement.classList.add('loading'); | 257 document.documentElement.classList.add('loading'); |
259 document.addEventListener('DOMContentLoaded', load); | 258 document.addEventListener('DOMContentLoaded', load); |
260 | 259 |
261 /** | 260 /** |
262 * Listener for the |beforeunload| event. | 261 * Listener for the |beforeunload| event. |
263 */ | 262 */ |
264 window.onbeforeunload = function() { | 263 window.onbeforeunload = function() { |
265 PageManager.willClose(); | 264 PageManager.willClose(); |
266 }; | 265 }; |
267 | 266 |
268 /** | 267 /** |
269 * Listener for the |popstate| event. | 268 * Listener for the |popstate| event. |
270 * @param {Event} e The |popstate| event. | 269 * @param {Event} e The |popstate| event. |
271 */ | 270 */ |
272 window.onpopstate = function(e) { | 271 window.onpopstate = function(e) { |
273 var pageName = PageManager.getPageNameFromPath(); | 272 var pageName = PageManager.getPageNameFromPath(); |
274 PageManager.setState(pageName, e.state); | 273 PageManager.setState(pageName, e.state); |
275 }; | 274 }; |
OLD | NEW |