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

Side by Side Diff: ui/webui/resources/js/cr/ui/controlled_indicator.js

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: update c/b/r/ as well Created 3 years, 12 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 cr.define('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 /** @const */ var BubbleButton = cr.ui.BubbleButton; 6 /** @const */ var BubbleButton = cr.ui.BubbleButton;
7 7
8 /** 8 /**
9 * An indicator that can be placed on a UI element as a hint to the user that 9 * An indicator that can be placed on a UI element as a hint to the user that
10 * the value is controlled by some external entity such as policy or an 10 * the value is controlled by some external entity such as policy or an
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 }, 56 },
57 57
58 /** 58 /**
59 * Returns a dictionary of the form { |controlled-by|: |bubbleText| }, where 59 * Returns a dictionary of the form { |controlled-by|: |bubbleText| }, where
60 * |controlled-by| is a valid value of the controlled-by property (see 60 * |controlled-by| is a valid value of the controlled-by property (see
61 * below), i.e. 'policy'. |bubbleText| is the default text to be shown for 61 * below), i.e. 'policy'. |bubbleText| is the default text to be shown for
62 * UI items with this controlled-by property value. The default 62 * UI items with this controlled-by property value. The default
63 * implementation does not set any strings. 63 * implementation does not set any strings.
64 * @return {Object} 64 * @return {Object}
65 */ 65 */
66 getDefaultStrings: function() { return {}; }, 66 getDefaultStrings: function() {
67 return {};
68 },
67 69
68 /** 70 /**
69 * Returns the text shown in the bubble. 71 * Returns the text shown in the bubble.
70 * @return {string} 72 * @return {string}
71 */ 73 */
72 getBubbleText: function() { 74 getBubbleText: function() {
73 var defaultStrings = this.getDefaultStrings(); 75 var defaultStrings = this.getDefaultStrings();
74 var text = defaultStrings[this.controlledBy]; 76 var text = defaultStrings[this.controlledBy];
75 77
76 if (this.hasAttribute('text' + this.controlledBy)) 78 if (this.hasAttribute('text' + this.controlledBy))
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 * - 'owner': A value is controlled by the owner of the device 116 * - 'owner': A value is controlled by the owner of the device
115 * (Chrome OS only). 117 * (Chrome OS only).
116 * - 'shared': A value belongs to the primary user but can be 118 * - 'shared': A value belongs to the primary user but can be
117 * modified (Chrome OS only). 119 * modified (Chrome OS only).
118 * - unset: The value is controlled by the user alone. 120 * - unset: The value is controlled by the user alone.
119 */ 121 */
120 cr.defineProperty(ControlledIndicator, 'controlledBy', cr.PropertyKind.ATTR); 122 cr.defineProperty(ControlledIndicator, 'controlledBy', cr.PropertyKind.ATTR);
121 123
122 return {ControlledIndicator: ControlledIndicator}; 124 return {ControlledIndicator: ControlledIndicator};
123 }); 125 });
OLDNEW
« no previous file with comments | « ui/webui/resources/js/cr/ui/context_menu_handler.js ('k') | ui/webui/resources/js/cr/ui/dialogs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698