| Index: chrome/browser/resources/help/help.js
|
| diff --git a/chrome/browser/resources/help/help.js b/chrome/browser/resources/help/help.js
|
| index e6c3f15f4cb2034a988490cb2930c6e5cb054514..88ba4b70e20e8b8a77abacf1b2a259b5f2124b41 100644
|
| --- a/chrome/browser/resources/help/help.js
|
| +++ b/chrome/browser/resources/help/help.js
|
| @@ -5,47 +5,48 @@
|
| <include src="../uber/uber_page_manager_observer.js">
|
| <include src="../uber/uber_utils.js">
|
|
|
| -var ChannelChangePage = help.ChannelChangePage;
|
| -var HelpPage = help.HelpPage;
|
| -var PageManager = cr.ui.pageManager.PageManager;
|
| -
|
| -/**
|
| - * DOMContentLoaded handler, sets up the page.
|
| - */
|
| -function load() {
|
| - PageManager.register(HelpPage.getInstance());
|
| -
|
| - if (cr.isChromeOS) {
|
| - PageManager.registerOverlay(ChannelChangePage.getInstance(),
|
| - HelpPage.getInstance());
|
| +(function() {
|
| + var HelpPage = help.HelpPage;
|
| + var PageManager = cr.ui.pageManager.PageManager;
|
| +
|
| + /**
|
| + * DOMContentLoaded handler, sets up the page.
|
| + */
|
| + function load() {
|
| + PageManager.register(HelpPage.getInstance());
|
| +
|
| + if (cr.isChromeOS) {
|
| + PageManager.registerOverlay(help.ChannelChangePage.getInstance(),
|
| + HelpPage.getInstance());
|
| + }
|
| + cr.ui.FocusManager.disableMouseFocusOnButtons();
|
| + PageManager.addObserver(new uber.PageManagerObserver());
|
| + PageManager.initialize(HelpPage.getInstance());
|
| + uber.onContentFrameLoaded();
|
| +
|
| + var pageName = PageManager.getPageNameFromPath();
|
| + // Still update history so that chrome://help/nonexistant redirects
|
| + // appropriately to chrome://help/. If the URL matches, updateHistory
|
| + // will avoid adding the extra state.
|
| + var updateHistory = true;
|
| + PageManager.showPageByName(pageName, updateHistory, {replaceState: true});
|
| }
|
| - cr.ui.FocusManager.disableMouseFocusOnButtons();
|
| - PageManager.addObserver(new uber.PageManagerObserver());
|
| - PageManager.initialize(HelpPage.getInstance());
|
| - uber.onContentFrameLoaded();
|
| -
|
| - var pageName = PageManager.getPageNameFromPath();
|
| - // Still update history so that chrome://help/nonexistant redirects
|
| - // appropriately to chrome://help/. If the URL matches, updateHistory
|
| - // will avoid adding the extra state.
|
| - var updateHistory = true;
|
| - PageManager.showPageByName(pageName, updateHistory, {replaceState: true});
|
| -}
|
| -
|
| -document.addEventListener('DOMContentLoaded', load);
|
| -
|
| -/**
|
| - * Listener for the |beforeunload| event.
|
| - */
|
| -window.onbeforeunload = function() {
|
| - PageManager.willClose();
|
| -};
|
| -
|
| -/**
|
| - * Listener for the |popstate| event.
|
| - * @param {Event} e The |popstate| event.
|
| - */
|
| -window.onpopstate = function(e) {
|
| - var pageName = PageManager.getPageNameFromPath();
|
| - PageManager.setState(pageName, e.state);
|
| -};
|
| +
|
| + document.addEventListener('DOMContentLoaded', load);
|
| +
|
| + /**
|
| + * Listener for the |beforeunload| event.
|
| + */
|
| + window.onbeforeunload = function() {
|
| + PageManager.willClose();
|
| + };
|
| +
|
| + /**
|
| + * Listener for the |popstate| event.
|
| + * @param {Event} e The |popstate| event.
|
| + */
|
| + window.onpopstate = function(e) {
|
| + var pageName = PageManager.getPageNameFromPath();
|
| + PageManager.setState(pageName, e.state);
|
| + };
|
| +})();
|
|
|