ApplicationImpl cleanup, part 1:
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / more-routing / driver / path-extracted.js
blobad64fd57fac6268f16c4e2a139c3d84bed41b4cf
2 (function(scope) {
3 var MoreRouting = scope.MoreRouting = scope.MoreRouting || {};
4 MoreRouting.PathDriver = PathDriver;
6 /**
7 * TODO(nevir): Docs.
8 */
9 function PathDriver() {
10 MoreRouting.Driver.apply(this, arguments);
11 this._bindEvents();
12 this._read();
14 PathDriver.prototype = Object.create(MoreRouting.Driver.prototype);
16 PathDriver.prototype.navigateToUrl = function navigateToUrl(url) {
17 window.history.pushState({}, '', url);
18 this._read();
21 PathDriver.prototype._bindEvents = function _bindEvents() {
22 window.addEventListener('popstate', this._read.bind(this));
25 PathDriver.prototype._read = function _read() {
26 this.setCurrentPath(window.location.pathname);
29 })(window);