OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 (function() { | 5 (function() { |
6 | 6 |
7 /** | 7 /** |
8 * Names of the radio buttons which allow the user to choose their encryption | 8 * Names of the radio buttons which allow the user to choose their encryption |
9 * mechanism. | 9 * mechanism. |
10 * @enum {string} | 10 * @enum {string} |
(...skipping 29 matching lines...) Expand all Loading... |
40 * | 40 * |
41 * <iron-animated-pages> | 41 * <iron-animated-pages> |
42 * <settings-sync-page></settings-sync-page> | 42 * <settings-sync-page></settings-sync-page> |
43 * ... other pages ... | 43 * ... other pages ... |
44 * </iron-animated-pages> | 44 * </iron-animated-pages> |
45 */ | 45 */ |
46 Polymer({ | 46 Polymer({ |
47 is: 'settings-sync-page', | 47 is: 'settings-sync-page', |
48 | 48 |
49 behaviors: [ | 49 behaviors: [ |
50 I18nBehavior, | |
51 WebUIListenerBehavior, | 50 WebUIListenerBehavior, |
52 settings.RouteObserverBehavior, | 51 settings.RouteObserverBehavior, |
53 ], | 52 ], |
54 | 53 |
55 properties: { | 54 properties: { |
56 /** @private */ | 55 /** @private */ |
57 pages: { | 56 pages: { |
58 type: Object, | 57 type: Object, |
59 value: settings.PageStatus, | 58 value: settings.PageStatus, |
60 readOnly: true, | 59 readOnly: true, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 * @param {string} passphrase The passphrase input field value | 284 * @param {string} passphrase The passphrase input field value |
286 * @param {string} confirmation The passphrase confirmation input field value. | 285 * @param {string} confirmation The passphrase confirmation input field value. |
287 * @return {boolean} Whether the passphrase save button should be enabled. | 286 * @return {boolean} Whether the passphrase save button should be enabled. |
288 * @private | 287 * @private |
289 */ | 288 */ |
290 isSaveNewPassphraseEnabled_: function(passphrase, confirmation) { | 289 isSaveNewPassphraseEnabled_: function(passphrase, confirmation) { |
291 return passphrase !== '' && confirmation !== ''; | 290 return passphrase !== '' && confirmation !== ''; |
292 }, | 291 }, |
293 | 292 |
294 /** | 293 /** |
295 * @param {!Event} e | |
296 * @private | |
297 */ | |
298 onSyncLearnMoreTap_: function(e) { | |
299 e.stopPropagation(); | |
300 }, | |
301 | |
302 /** | |
303 * Sends the newly created custom sync passphrase to the browser. | 294 * Sends the newly created custom sync passphrase to the browser. |
304 * @private | 295 * @private |
305 */ | 296 */ |
306 onSaveNewPassphraseTap_: function() { | 297 onSaveNewPassphraseTap_: function() { |
307 assert(this.creatingNewPassphrase_); | 298 assert(this.creatingNewPassphrase_); |
308 | 299 |
309 // If a new password has been entered but it is invalid, do not send the | 300 // If a new password has been entered but it is invalid, do not send the |
310 // sync state to the API. | 301 // sync state to the API. |
311 if (!this.validateCreatedPassphrases_()) | 302 if (!this.validateCreatedPassphrases_()) |
312 return; | 303 return; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 !emptyPassphrase && mismatchedPassphrase; | 418 !emptyPassphrase && mismatchedPassphrase; |
428 | 419 |
429 return !emptyPassphrase && !mismatchedPassphrase; | 420 return !emptyPassphrase && !mismatchedPassphrase; |
430 }, | 421 }, |
431 | 422 |
432 /** | 423 /** |
433 * @param {!Event} event | 424 * @param {!Event} event |
434 * @private | 425 * @private |
435 */ | 426 */ |
436 onLearnMoreTap_: function(event) { | 427 onLearnMoreTap_: function(event) { |
437 // Stop the propagation of events, so that clicking on links inside | 428 if (event.target.tagName == 'A') { |
438 // checkbox labels won't change the checkbox value. | 429 // Stop the propagation of events, so that clicking on links inside |
439 event.stopPropagation(); | 430 // checkboxes or radio buttons won't change the value. |
| 431 event.stopPropagation(); |
| 432 } |
440 } | 433 } |
441 }); | 434 }); |
442 | 435 |
443 })(); | 436 })(); |
OLD | NEW |