Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
| 8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 var that = this; | 183 var that = this; |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * @param {boolean} supported True if crash dump reporting is supported by | 186 * @param {boolean} supported True if crash dump reporting is supported by |
| 187 * the host. | 187 * the host. |
| 188 * @param {boolean} allowed True if crash dump reporting is allowed. | 188 * @param {boolean} allowed True if crash dump reporting is allowed. |
| 189 * @param {boolean} set_by_policy True if crash dump reporting is controlled | 189 * @param {boolean} set_by_policy True if crash dump reporting is controlled |
| 190 * by policy. | 190 * by policy. |
| 191 */ | 191 */ |
| 192 function onGetConsent(supported, allowed, set_by_policy) { | 192 function onGetConsent(supported, allowed, set_by_policy) { |
| 193 that.usageStats_.hidden = !supported; | 193 // Hide the usage stats check box if it is not supported or the policy |
| 194 // doesn't allow usage stats collection. | |
| 195 that.usageStats_.hidden = !supported || (set_by_policy && !allowed); | |
| 194 that.usageStatsCheckbox_.checked = allowed; | 196 that.usageStatsCheckbox_.checked = allowed; |
| 195 that.usageStatsCheckbox_.disabled = set_by_policy; | 197 |
| 198 if (set_by_policy) { | |
| 199 that.usageStatsCheckbox_.disabled = true; | |
| 200 that.usageStatsCheckbox_.title = l10n.getTranslationOrError( | |
|
Jamie
2015/02/06 02:22:02
Do the disables and title attributes apply to both
kelvinp
2015/02/06 19:50:21
Done.
| |
| 201 /*i18n-content*/ 'SETTING_MANAGED_BY_POLICY'); | |
| 202 } else { | |
| 203 that.usageStatsCheckbox_.disabled = false; | |
| 204 that.usageStatsCheckbox_.title = ''; | |
| 205 } | |
| 196 } | 206 } |
| 197 | 207 |
| 198 /** @param {remoting.Error} error */ | 208 /** @param {remoting.Error} error */ |
| 199 function onError(error) { | 209 function onError(error) { |
| 200 console.error('Error getting consent status: ' + error); | 210 console.error('Error getting consent status: ' + error); |
| 201 } | 211 } |
| 202 | 212 |
| 203 this.usageStats_.hidden = false; | 213 this.usageStats_.hidden = false; |
| 204 this.usageStatsCheckbox_.checked = false; | 214 this.usageStatsCheckbox_.checked = false; |
| 205 | 215 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 var c = pin.charAt(i); | 560 var c = pin.charAt(i); |
| 551 if ((c < '0') || (c > '9')) { | 561 if ((c < '0') || (c > '9')) { |
| 552 return false; | 562 return false; |
| 553 } | 563 } |
| 554 } | 564 } |
| 555 return true; | 565 return true; |
| 556 }; | 566 }; |
| 557 | 567 |
| 558 /** @type {remoting.HostSetupDialog} */ | 568 /** @type {remoting.HostSetupDialog} */ |
| 559 remoting.hostSetupDialog = null; | 569 remoting.hostSetupDialog = null; |
| OLD | NEW |