Chromium Code Reviews| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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} |
|
dschuyler
2016/06/30 22:26:33
Is it workable to set the type here to
{!setting
tommycli
2016/06/30 22:32:51
No, because it's genuinely undefined until it's in
Dan Beam
2016/06/30 23:38:00
fyi: ?Type means Type|null
This seems like Type|u
tommycli
2016/06/30 23:51:18
Done.
| |
| 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 if (!this.syncPrefs) | |
| 245 return; | |
| 244 this.browserProxy_.setSyncDatatypes(this.syncPrefs).then( | 246 this.browserProxy_.setSyncDatatypes(this.syncPrefs).then( |
| 245 this.handlePageStatusChanged_.bind(this)); | 247 this.handlePageStatusChanged_.bind(this)); |
| 246 }, | 248 }, |
| 247 | 249 |
| 248 /** @private */ | 250 /** @private */ |
| 249 onManageSyncedDataTap_: function() { | 251 onManageSyncedDataTap_: function() { |
| 250 window.open(loadTimeData.getString('syncDashboardUrl')); | 252 window.open(loadTimeData.getString('syncDashboardUrl')); |
| 251 }, | 253 }, |
| 252 | 254 |
| 253 /** | 255 /** |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 | 398 |
| 397 passphraseInput.invalid = emptyPassphrase; | 399 passphraseInput.invalid = emptyPassphrase; |
| 398 passphraseConfirmationInput.invalid = | 400 passphraseConfirmationInput.invalid = |
| 399 !emptyPassphrase && mismatchedPassphrase; | 401 !emptyPassphrase && mismatchedPassphrase; |
| 400 | 402 |
| 401 return !emptyPassphrase && !mismatchedPassphrase; | 403 return !emptyPassphrase && !mismatchedPassphrase; |
| 402 }, | 404 }, |
| 403 }); | 405 }); |
| 404 | 406 |
| 405 })(); | 407 })(); |
| OLD | NEW |