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 'password-edit-dialog' is the dialog that allows showing a | 6 * @fileoverview 'password-edit-dialog' is the dialog that allows showing a |
7 * saved password. | 7 * saved password. |
8 */ | 8 */ |
9 (function() { | 9 (function() { |
10 'use strict'; | 10 'use strict'; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 /** @private */ | 44 /** @private */ |
45 email_: String, | 45 email_: String, |
46 | 46 |
47 /** @private */ | 47 /** @private */ |
48 canSave_: Boolean, | 48 canSave_: Boolean, |
49 }, | 49 }, |
50 | 50 |
51 /** @override */ | 51 /** @override */ |
52 attached: function() { | 52 attached: function() { |
53 this.countryInfo = | 53 this.countryInfo = settings.address.CountryDetailManagerImpl.getInstance(); |
54 settings.address.CountryDetailManagerImpl.getInstance(); | |
55 this.countryInfo.getCountryList().then(function(countryList) { | 54 this.countryInfo.getCountryList().then(function(countryList) { |
56 this.countries_ = countryList; | 55 this.countries_ = countryList; |
57 | 56 |
58 this.title_ = | 57 this.title_ = |
59 this.i18n(this.address.guid ? 'editAddressTitle' : 'addAddressTitle'); | 58 this.i18n(this.address.guid ? 'editAddressTitle' : 'addAddressTitle'); |
60 | 59 |
61 // |phoneNumbers| and |emailAddresses| are a single item array. | 60 // |phoneNumbers| and |emailAddresses| are a single item array. |
62 // See crbug.com/497934 for details. | 61 // See crbug.com/497934 for details. |
63 this.phoneNumber_ = | 62 this.phoneNumber_ = |
64 this.address.phoneNumbers ? this.address.phoneNumbers[0] : ''; | 63 this.address.phoneNumbers ? this.address.phoneNumbers[0] : ''; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 }.bind(this)); | 98 }.bind(this)); |
100 }.bind(this)); | 99 }.bind(this)); |
101 | 100 |
102 // Flush dom before resize and savability updates. | 101 // Flush dom before resize and savability updates. |
103 Polymer.dom.flush(); | 102 Polymer.dom.flush(); |
104 | 103 |
105 this.updateCanSave_(); | 104 this.updateCanSave_(); |
106 | 105 |
107 this.fire('on-update-address-wrapper'); // For easier testing. | 106 this.fire('on-update-address-wrapper'); // For easier testing. |
108 | 107 |
109 var dialog = /** @type {HTMLDialogElement} */(this.$.dialog); | 108 var dialog = /** @type {HTMLDialogElement} */ (this.$.dialog); |
110 if (!dialog.open) | 109 if (!dialog.open) |
111 dialog.showModal(); | 110 dialog.showModal(); |
112 }.bind(this)); | 111 }.bind(this)); |
113 }, | 112 }, |
114 | 113 |
115 updateCanSave_: function() { | 114 updateCanSave_: function() { |
116 var inputs = this.$.dialog.querySelectorAll('.address-column, select'); | 115 var inputs = this.$.dialog.querySelectorAll('.address-column, select'); |
117 | 116 |
118 for (var i = 0; i < inputs.length; ++i) { | 117 for (var i = 0; i < inputs.length; ++i) { |
119 if (inputs[i].value) { | 118 if (inputs[i].value) { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 }); | 337 }); |
339 }, | 338 }, |
340 }; | 339 }; |
341 | 340 |
342 return { | 341 return { |
343 AddressComponentUI: AddressComponentUI, | 342 AddressComponentUI: AddressComponentUI, |
344 CountryDetailManager: CountryDetailManager, | 343 CountryDetailManager: CountryDetailManager, |
345 CountryDetailManagerImpl: CountryDetailManagerImpl, | 344 CountryDetailManagerImpl: CountryDetailManagerImpl, |
346 }; | 345 }; |
347 }); | 346 }); |
OLD | NEW |