| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview settings-startup-url-entry represents a UI component that | 6 * @fileoverview settings-startup-url-entry represents a UI component that |
| 7 * displayes a URL that is loaded during startup. It includes a menu that allows | 7 * displayes a URL that is loaded during startup. It includes a menu that allows |
| 8 * the user to edit/remove the entry. | 8 * the user to edit/remove the entry. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 cr.exportPath('settings'); | 11 cr.exportPath('settings'); |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * The name of the event fired from this element when the "Edit" option is | 14 * The name of the event fired from this element when the "Edit" option is |
| 15 * tapped. | 15 * tapped. |
| 16 * @const {string} | 16 * @const {string} |
| 17 */ | 17 */ |
| 18 settings.EDIT_STARTUP_URL_EVENT = 'edit-startup-url'; | 18 settings.EDIT_STARTUP_URL_EVENT = 'edit-startup-url'; |
| 19 | 19 |
| 20 Polymer({ | 20 Polymer({ |
| 21 is: 'settings-startup-url-entry', | 21 is: 'settings-startup-url-entry', |
| 22 | 22 |
| 23 behaviors: [ListItemBehavior], |
| 24 |
| 23 properties: { | 25 properties: { |
| 24 /** @type {!StartupPageInfo} */ | 26 /** @type {!StartupPageInfo} */ |
| 25 model: Object, | 27 model: Object, |
| 26 }, | 28 }, |
| 27 | 29 |
| 28 /** | 30 /** |
| 29 * @param {string} url Location of an image to get a set of icons for. | 31 * @param {string} url Location of an image to get a set of icons for. |
| 30 * @return {string} A set of icon URLs. | 32 * @return {string} A set of icon URLs. |
| 31 * @private | 33 * @private |
| 32 */ | 34 */ |
| 33 getIconSet_: function(url) { | 35 getIconSet_: function(url) { |
| 34 return cr.icon.getFavicon(url); | 36 return cr.icon.getFavicon(url); |
| 35 }, | 37 }, |
| 36 | 38 |
| 37 /** @private */ | 39 /** @private */ |
| 38 onRemoveTap_: function() { | 40 onRemoveTap_: function() { |
| 39 this.$$('iron-dropdown').close(); | 41 this.$$('iron-dropdown').close(); |
| 40 settings.StartupUrlsPageBrowserProxyImpl.getInstance().removeStartupPage( | 42 settings.StartupUrlsPageBrowserProxyImpl.getInstance().removeStartupPage( |
| 41 this.model.modelIndex); | 43 this.model.modelIndex); |
| 42 }, | 44 }, |
| 43 | 45 |
| 44 /** @private */ | 46 /** @private */ |
| 45 onEditTap_: function() { | 47 onEditTap_: function() { |
| 46 this.$$('iron-dropdown').close(); | 48 this.$$('iron-dropdown').close(); |
| 47 this.fire(settings.EDIT_STARTUP_URL_EVENT, this.model); | 49 this.fire(settings.EDIT_STARTUP_URL_EVENT, this.model); |
| 48 }, | 50 }, |
| 49 }); | 51 }); |
| OLD | NEW |