Service workers: Allow HTTPS pages arrived at via HTTP redirect to use SW
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / more-routing / driver / path-extracted.js
blob09141d304006d768e35721e7daa5324ed7f4610c
1 (function(scope) {
2 var MoreRouting = scope.MoreRouting = scope.MoreRouting || {};
3 MoreRouting.PathDriver = PathDriver;
5 /**
6  * TODO(nevir): Docs.
7  */
8 function PathDriver() {
9   MoreRouting.Driver.apply(this, arguments);
10   this._bindEvents();
11   this._read();
13 PathDriver.prototype = Object.create(MoreRouting.Driver.prototype);
15 PathDriver.prototype.navigateToUrl = function navigateToUrl(url) {
16   window.history.pushState({}, '', url);
17   this._read();
20 PathDriver.prototype._bindEvents = function _bindEvents() {
21   window.addEventListener('popstate', this._read.bind(this));
24 PathDriver.prototype._read = function _read() {
25   this.setCurrentPath(window.location.pathname);
28 })(window);