| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --><html><head><link rel="import" href="ct-user-prefs.html"> |
| 6 | 6 |
| 7 <link rel="import" href="ct-user-prefs.html"> | 7 <dom-module id="ct-builder"> |
| 8 | |
| 9 <polymer-element name="ct-builder" attributes="builder"> | |
| 10 <template> | 8 <template> |
| 11 <ct-user-prefs id="userPrefs"></ct-user-prefs> | 9 <ct-user-prefs id="userPrefs"></ct-user-prefs> |
| 12 <a target="{{ $.userPrefs.values.linkTarget }}" href="{{ {url: builder.build
Url, useUber: $.userPrefs.values.useUberchromegw} | rewriteUrl }}" style="white-
space: nowrap">{{ builder.builder }}</a> | 10 <a target="{{ $.userPrefs.values.linkTarget }}" style="white-space: nowrap"
href$="{{computeHref($, builder)}}">{{ builder.builder }}</a> |
| 13 </template> | 11 </template> |
| 14 <script> | 12 <script> |
| 15 Polymer({ | 13 Polymer({ |
| 16 rewriteUrl: function(props) { | 14 is: 'ct-builder', |
| 17 if (this.$ && this.$.userPrefs) { | 15 properties: { builder: { notify: true } }, |
| 18 return this.$.userPrefs.rewriteUrl(props.url); | 16 rewriteUrl: function (props) { |
| 17 if (this.$ && this.$.userPrefs) { |
| 18 return this.$.userPrefs.rewriteUrl(props.url); |
| 19 } |
| 20 return props.url; |
| 21 }, |
| 22 computeHref: function ($, builder) { |
| 23 return this.rewriteUrl({ |
| 24 url: builder.buildUrl, |
| 25 useUber: $.userPrefs.values.useUberchromegw |
| 26 }); |
| 19 } | 27 } |
| 20 return props.url; | 28 }); |
| 21 }, | |
| 22 }); | |
| 23 </script> | 29 </script> |
| 24 </polymer-element> | 30 </dom-module> |
| OLD | NEW |