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 / more-routing-config-extracted.js
blob27825c98c9c3437231b7278785e4c8162ca6f925
1 Polymer({
3     is: 'more-routing-config',
5     properties: {
7       /**
8        * The routing driver to use.
9        *
10        *  * `hash`: `MoreRouting.HashDriver`
11        *  * `path`: `MoreRouting.PathDriver`
12        *  * `mock`: `MoreRouting.MockDriver`
13        *
14        */
15       driver: String,
17       /**
18        *
19        */
20       urlPrefix: String,
22     },
24     ready: function() {
25       var config = {};
26       if (this.urlPrefix) config.prefix = this.urlPrefix;
28       var driver;
29       // TODO(nevir): Support custom drivers, too.
30       if (this.driver === 'hash') {
31         driver = new MoreRouting.HashDriver(config);
32       } else if (this.driver === 'path') {
33         driver = new MoreRouting.PathDriver(config);
34       } else if (this.driver === 'mock') {
35         driver = new MoreRouting.MockDriver(config);
36       } else {
37         throw new Error('Unknown driver type "' + this.driver + '"');
38       }
40       MoreRouting.driver = driver;
41     },
43   });