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 <include src="../uber/uber_page_manager_observer.js"> | 5 // <include src="../uber/uber_page_manager_observer.js"> |
6 <include src="../uber/uber_utils.js"> | 6 // <include src="../uber/uber_utils.js"> |
7 | 7 |
8 (function() { | 8 (function() { |
9 var HelpPage = help.HelpPage; | 9 var HelpPage = help.HelpPage; |
10 var PageManager = cr.ui.pageManager.PageManager; | 10 var PageManager = cr.ui.pageManager.PageManager; |
11 | 11 |
12 /** | 12 /** |
13 * DOMContentLoaded handler, sets up the page. | 13 * DOMContentLoaded handler, sets up the page. |
14 */ | 14 */ |
15 function load() { | 15 function load() { |
16 PageManager.register(HelpPage.getInstance()); | 16 PageManager.register(HelpPage.getInstance()); |
17 | 17 |
18 if (help.ChannelChangePage) { | 18 if (help.ChannelChangePage) { |
19 PageManager.registerOverlay(help.ChannelChangePage.getInstance(), | 19 PageManager.registerOverlay( |
20 HelpPage.getInstance()); | 20 help.ChannelChangePage.getInstance(), HelpPage.getInstance()); |
21 } | 21 } |
22 PageManager.addObserver(new uber.PageManagerObserver()); | 22 PageManager.addObserver(new uber.PageManagerObserver()); |
23 PageManager.initialize(HelpPage.getInstance()); | 23 PageManager.initialize(HelpPage.getInstance()); |
24 uber.onContentFrameLoaded(); | 24 uber.onContentFrameLoaded(); |
25 | 25 |
26 var pageName = PageManager.getPageNameFromPath(); | 26 var pageName = PageManager.getPageNameFromPath(); |
27 // Still update history so that chrome://help/nonexistant redirects | 27 // Still update history so that chrome://help/nonexistant redirects |
28 // appropriately to chrome://help/. If the URL matches, updateHistory | 28 // appropriately to chrome://help/. If the URL matches, updateHistory |
29 // will avoid adding the extra state. | 29 // will avoid adding the extra state. |
30 var updateHistory = true; | 30 var updateHistory = true; |
(...skipping 11 matching lines...) Expand all Loading... |
42 | 42 |
43 /** | 43 /** |
44 * Listener for the |popstate| event. | 44 * Listener for the |popstate| event. |
45 * @param {Event} e The |popstate| event. | 45 * @param {Event} e The |popstate| event. |
46 */ | 46 */ |
47 window.onpopstate = function(e) { | 47 window.onpopstate = function(e) { |
48 var pageName = PageManager.getPageNameFromPath(); | 48 var pageName = PageManager.getPageNameFromPath(); |
49 PageManager.setState(pageName, location.hash, e.state); | 49 PageManager.setState(pageName, location.hash, e.state); |
50 }; | 50 }; |
51 })(); | 51 })(); |
OLD | NEW |