| 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 his encryption | 8 * Names of the radio buttons which allow the user to choose his encryption |
| 9 * mechanism. | 9 * mechanism. |
| 10 * @enum {string} | 10 * @enum {string} |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 properties: { | 54 properties: { |
| 55 /** @private */ | 55 /** @private */ |
| 56 pages: { | 56 pages: { |
| 57 type: Object, | 57 type: Object, |
| 58 value: settings.PageStatus, | 58 value: settings.PageStatus, |
| 59 readOnly: true, | 59 readOnly: true, |
| 60 }, | 60 }, |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * The curerntly displayed page. | 63 * The curerntly displayed page. |
| 64 * @private {!settings.PageStatus} | 64 * @private {?settings.PageStatus} |
| 65 */ | 65 */ |
| 66 selectedPage_: { | 66 selectedPage_: { |
| 67 type: String, | 67 type: String, |
| 68 value: settings.PageStatus.SPINNER, | 68 value: settings.PageStatus.SPINNER, |
| 69 }, | 69 }, |
| 70 | 70 |
| 71 /** | 71 /** |
| 72 * The current active route. | 72 * The current active route. |
| 73 */ | 73 */ |
| 74 currentRoute: { | 74 currentRoute: { |
| 75 type: Object, | 75 type: Object, |
| 76 observer: 'currentRouteChanged_', | 76 observer: 'currentRouteChanged_', |
| 77 }, | 77 }, |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * The current sync preferences, supplied by SyncBrowserProxy. | 80 * The current sync preferences, supplied by SyncBrowserProxy. |
| 81 * @type {?settings.SyncPrefs} | 81 * @type {settings.SyncPrefs|undefined} |
| 82 */ | 82 */ |
| 83 syncPrefs: { | 83 syncPrefs: { |
| 84 type: Object, | 84 type: Object, |
| 85 }, | 85 }, |
| 86 | 86 |
| 87 /** | 87 /** |
| 88 * Caches the individually selected synced data types. This is used to | 88 * Caches the individually selected synced data types. This is used to |
| 89 * be able to restore the selections after checking and unchecking Sync All. | 89 * be able to restore the selections after checking and unchecking Sync All. |
| 90 * @private | 90 * @private |
| 91 */ | 91 */ |
| 92 cachedSyncPrefs_: { | 92 cachedSyncPrefs_: { |
| 93 type: Object, | 93 type: Object, |
| 94 }, | 94 }, |
| 95 | 95 |
| 96 /** | 96 /** |
| 97 * Whether the "create passphrase" inputs should be shown. These inputs | 97 * Whether the "create passphrase" inputs should be shown. These inputs |
| 98 * give the user the opportunity to use a custom passphrase instead of | 98 * give the user the opportunity to use a custom passphrase instead of |
| 99 * authenticating with his Google credentials. | 99 * authenticating with his Google credentials. |
| 100 * @private | 100 * @private |
| 101 */ | 101 */ |
| 102 creatingNewPassphrase_: { | 102 creatingNewPassphrase_: { |
| 103 type: Boolean, | 103 type: Boolean, |
| 104 value: false, | 104 value: false, |
| 105 }, | 105 }, |
| 106 | 106 |
| 107 /** @private {!settings.SyncBrowserProxyImpl} */ | 107 /** @private {!settings.SyncBrowserProxy} */ |
| 108 browserProxy_: { | 108 browserProxy_: { |
| 109 type: Object, | 109 type: Object, |
| 110 value: function() { | 110 value: function() { |
| 111 return settings.SyncBrowserProxyImpl.getInstance(); | 111 return settings.SyncBrowserProxyImpl.getInstance(); |
| 112 }, | 112 }, |
| 113 }, | 113 }, |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * The unload callback is needed because the sign-in flow needs to know | 116 * The unload callback is needed because the sign-in flow needs to know |
| 117 * if the user has closed the tab with the sync settings. This property is | 117 * if the user has closed the tab with the sync settings. This property is |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 234 } |
| 235 | 235 |
| 236 this.onSingleSyncDataTypeChanged_(); | 236 this.onSingleSyncDataTypeChanged_(); |
| 237 }, | 237 }, |
| 238 | 238 |
| 239 /** | 239 /** |
| 240 * Handler for when any sync data type checkbox is changed (except autofill). | 240 * Handler for when any sync data type checkbox is changed (except autofill). |
| 241 * @private | 241 * @private |
| 242 */ | 242 */ |
| 243 onSingleSyncDataTypeChanged_: function() { | 243 onSingleSyncDataTypeChanged_: function() { |
| 244 assert(this.syncPrefs); |
| 244 this.browserProxy_.setSyncDatatypes(this.syncPrefs).then( | 245 this.browserProxy_.setSyncDatatypes(this.syncPrefs).then( |
| 245 this.handlePageStatusChanged_.bind(this)); | 246 this.handlePageStatusChanged_.bind(this)); |
| 246 }, | 247 }, |
| 247 | 248 |
| 248 /** @private */ | 249 /** @private */ |
| 249 onManageSyncedDataTap_: function() { | 250 onManageSyncedDataTap_: function() { |
| 250 window.open(loadTimeData.getString('syncDashboardUrl')); | 251 window.open(loadTimeData.getString('syncDashboardUrl')); |
| 251 }, | 252 }, |
| 252 | 253 |
| 253 /** | 254 /** |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 397 |
| 397 passphraseInput.invalid = emptyPassphrase; | 398 passphraseInput.invalid = emptyPassphrase; |
| 398 passphraseConfirmationInput.invalid = | 399 passphraseConfirmationInput.invalid = |
| 399 !emptyPassphrase && mismatchedPassphrase; | 400 !emptyPassphrase && mismatchedPassphrase; |
| 400 | 401 |
| 401 return !emptyPassphrase && !mismatchedPassphrase; | 402 return !emptyPassphrase && !mismatchedPassphrase; |
| 402 }, | 403 }, |
| 403 }); | 404 }); |
| 404 | 405 |
| 405 })(); | 406 })(); |
| OLD | NEW |