Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/browser/resources/settings/on_startup_page/startup_url_entry.js

Issue 1882483002: MD Settings: OnStartup, implementing "Edit" functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@edit_on_startup_move_delete
Patch Set: Event name. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 cr.define('settings', function() {
12 /**
13 * The name of the event fired from this element when the "Edit" option is
14 * tapped.
15 * @type {string}
16 */
17 var EditStartupUrlEvent = 'edit-startup-url';
18
19 return {
20 EditStartupUrlEvent: EditStartupUrlEvent,
21 };
22 });
dschuyler 2016/04/14 00:49:38 Can the above be simplified?
dpapad 2016/04/14 01:13:39 First, I added a compile target for this to ensure
Dan Beam 2016/04/14 01:32:30 cr.exportPath('settings'); /** @type {string} */
dpapad 2016/04/14 01:50:53 Done the simplification. Also changed to @const an
23
10 Polymer({ 24 Polymer({
11 is: 'settings-startup-url-entry', 25 is: 'settings-startup-url-entry',
12 26
13 properties: { 27 properties: {
14 /** @type {!StartupPageInfo} */ 28 /** @type {!StartupPageInfo} */
15 model: Object, 29 model: Object,
16 }, 30 },
17 31
18 /** 32 /**
19 * @param {string} url Location of an image to get a set of icons fors. 33 * @param {string} url Location of an image to get a set of icons fors.
20 * @return {string} A set of icon URLs. 34 * @return {string} A set of icon URLs.
21 * @private 35 * @private
22 */ 36 */
23 getIconSet_: function(url) { 37 getIconSet_: function(url) {
24 return getFaviconImageSet(url); 38 return getFaviconImageSet(url);
25 }, 39 },
26 40
27 /** @private */ 41 /** @private */
28 onRemoveTap_: function() { 42 onRemoveTap_: function() {
43 this.$$('iron-dropdown').close();
29 settings.StartupUrlsPageBrowserProxyImpl.getInstance().removeStartupPage( 44 settings.StartupUrlsPageBrowserProxyImpl.getInstance().removeStartupPage(
30 this.model.modelIndex); 45 this.model.modelIndex);
31 }, 46 },
47
48 /** @private */
49 onEditTap_: function() {
50 this.$$('iron-dropdown').close();
51 this.fire(settings.EditStartupUrlEvent, this.model);
52 },
32 }); 53 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698