| Index: ui/webui/resources/js/cr/ui/page_manager/page.js
|
| diff --git a/ui/webui/resources/js/cr/ui/page_manager/page.js b/ui/webui/resources/js/cr/ui/page_manager/page.js
|
| index c420a0d2b284da9a1df795bc37e3579b4a0f6f7d..72219354a1ee5aac2a1651337b340101e57279e6 100644
|
| --- a/ui/webui/resources/js/cr/ui/page_manager/page.js
|
| +++ b/ui/webui/resources/js/cr/ui/page_manager/page.js
|
| @@ -28,6 +28,7 @@ cr.define('cr.ui.pageManager', function() {
|
| this.pageDiv.page = null;
|
| this.tab = null;
|
| this.lastFocusedElement = null;
|
| + this.hash = '';
|
| }
|
|
|
| Page.prototype = {
|
| @@ -66,6 +67,12 @@ cr.define('cr.ui.pageManager', function() {
|
| initializePage: function() {},
|
|
|
| /**
|
| + * Called by the PageManager when this.hash changes while the page is
|
| + * already visible. This is analogous to the hashchange DOM event.
|
| + */
|
| + didChangeHash: function() {},
|
| +
|
| + /**
|
| * Sets focus on the first focusable element. Override for a custom focus
|
| * strategy.
|
| */
|
| @@ -118,6 +125,19 @@ cr.define('cr.ui.pageManager', function() {
|
| },
|
|
|
| /**
|
| + * Updates the hash of the current page. If the page is topmost, the history
|
| + * state is updated.
|
| + * @param {string} hash The new hash value. Like location.hash, this
|
| + * should include the leading '#' if not empty.
|
| + */
|
| + setHash: function(hash) {
|
| + if (this.hash == hash)
|
| + return;
|
| + this.hash = hash;
|
| + PageManager.onPageHashChanged(this);
|
| + },
|
| +
|
| + /**
|
| * Gets the container div for this page if it is an overlay.
|
| * @type {HTMLDivElement}
|
| */
|
|
|