Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.js

Issue 2597013002: Run clang-format on ui/webui/resources (Closed)
Patch Set: remove cr_shared_menu.js Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /** 5 /**
6 * @fileoverview Polymer element for indicating policies based on network 6 * @fileoverview Polymer element for indicating policies based on network
7 * properties. 7 * properties.
8 */ 8 */
9 9
10 Polymer({ 10 Polymer({
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 var effective = property.Effective; 44 var effective = property.Effective;
45 var active = property.Active; 45 var active = property.Active;
46 if (active == undefined) 46 if (active == undefined)
47 active = property[effective]; 47 active = property[effective];
48 48
49 if (property.UserEditable === true && 49 if (property.UserEditable === true &&
50 property.hasOwnProperty('UserPolicy')) { 50 property.hasOwnProperty('UserPolicy')) {
51 // We ignore UserEditable unless there is a UserPolicy. 51 // We ignore UserEditable unless there is a UserPolicy.
52 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED; 52 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED;
53 this.recommended = 53 this.recommended =
54 /** @type {CrOnc.NetworkPropertyType} */(property.UserPolicy); 54 /** @type {CrOnc.NetworkPropertyType} */ (property.UserPolicy);
55 } else if (property.DeviceEditable === true && 55 } else if (
56 property.hasOwnProperty('DevicePolicy')) { 56 property.DeviceEditable === true &&
57 property.hasOwnProperty('DevicePolicy')) {
57 // We ignore DeviceEditable unless there is a DevicePolicy. 58 // We ignore DeviceEditable unless there is a DevicePolicy.
58 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED; 59 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED;
59 this.recommended = 60 this.recommended =
60 /** @type {CrOnc.NetworkPropertyType} */(property.DevicePolicy); 61 /** @type {CrOnc.NetworkPropertyType} */ (property.DevicePolicy);
61 } else if (effective == 'UserPolicy') { 62 } else if (effective == 'UserPolicy') {
62 this.indicatorType = CrPolicyIndicatorType.USER_POLICY; 63 this.indicatorType = CrPolicyIndicatorType.USER_POLICY;
63 } else if (effective == 'DevicePolicy') { 64 } else if (effective == 'DevicePolicy') {
64 this.indicatorType = CrPolicyIndicatorType.DEVICE_POLICY; 65 this.indicatorType = CrPolicyIndicatorType.DEVICE_POLICY;
65 } else if (effective == 'ActiveExtension') { 66 } else if (effective == 'ActiveExtension') {
66 this.indicatorType = CrPolicyIndicatorType.EXTENSION; 67 this.indicatorType = CrPolicyIndicatorType.EXTENSION;
67 } else { 68 } else {
68 this.indicatorType = CrPolicyIndicatorType.NONE; 69 this.indicatorType = CrPolicyIndicatorType.NONE;
69 } 70 }
70 }, 71 },
(...skipping 12 matching lines...) Expand all
83 var value = property.Active; 84 var value = property.Active;
84 if (value == undefined && property.Effective) 85 if (value == undefined && property.Effective)
85 value = property[property.Effective]; 86 value = property[property.Effective];
86 if (value == recommended) 87 if (value == recommended)
87 return this.i18n_('controlledSettingRecommendedMatches'); 88 return this.i18n_('controlledSettingRecommendedMatches');
88 return this.i18n_('controlledSettingRecommendedDiffers'); 89 return this.i18n_('controlledSettingRecommendedDiffers');
89 } 90 }
90 return this.getPolicyIndicatorTooltip(type, ''); 91 return this.getPolicyIndicatorTooltip(type, '');
91 } 92 }
92 }); 93 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698