| Index: chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| diff --git a/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js b/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| index 524a21dd58c7d1ea2d668e667256f98b7c61d6e2..35378eadfaa13989a100cfd31c8da71539b3d115 100644
|
| --- a/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| +++ b/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| @@ -38,8 +38,10 @@ Polymer({
|
| notify: true,
|
| },
|
|
|
| - newUrl: {
|
| + /** @private {string} */
|
| + newUrl_: {
|
| type: String,
|
| + value: '',
|
| },
|
|
|
| /**
|
| @@ -68,6 +70,7 @@ Polymer({
|
|
|
| /** @private */
|
| onAddPageTap_: function() {
|
| + this.newUrl_ = '';
|
| this.$.addUrlDialog.open();
|
| },
|
|
|
| @@ -81,13 +84,18 @@ Polymer({
|
| this.$.addUrlDialog.close();
|
| },
|
|
|
| + /**
|
| + * @return {boolean} Whether tapping the OK button should be allowed.
|
| + * @private
|
| + */
|
| + isOkAllowed_: function() {
|
| + return this.newUrl_.trim().length > 0;
|
| + },
|
| +
|
| /** @private */
|
| onOkTap_: function() {
|
| - var value = this.newUrl && this.newUrl.trim();
|
| - if (!value)
|
| - return;
|
| - chrome.send('addStartupPage', [value]);
|
| - this.newUrl = '';
|
| + assert(this.isOkAllowed_());
|
| + chrome.send('addStartupPage', [this.newUrl_.trim()]);
|
| this.$.addUrlDialog.close();
|
| },
|
|
|
|
|