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

Unified Diff: chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js

Issue 2600683002: Run tools/clang-format-js on some of chrome/browser/resources/ (Closed)
Patch Set: hackhackhack Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js
diff --git a/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js b/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js
index f89d0d58c952d6a531c8c05e072da60945513365..19849927c238611480020689a3be30e8f9c05678 100644
--- a/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js
+++ b/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js
@@ -9,136 +9,134 @@
* exit and childlock their profile.
*/
(function() {
-/**
- * Maximum length of the supervised user profile name or custodian's username.
- * @const {number}
- */
-var MAX_NAME_LENGTH = 50;
+ /**
+ * Maximum length of the supervised user profile name or custodian's username.
+ * @const {number}
+ */
+ var MAX_NAME_LENGTH = 50;
+
+ Polymer({
+ is: 'supervised-user-create-confirm',
+
+ behaviors: [I18nBehavior],
+
+ properties: {
+ /**
+ * Profile Info of the supervised user that is passed to the page.
+ * @type {?ProfileInfo}
+ */
+ profileInfo: {
+ type: Object,
+ value: function() {
+ return null;
+ }
+ },
+
+ /** @private {!signin.ProfileBrowserProxy} */
+ browserProxy_: Object
+ },
-Polymer({
- is: 'supervised-user-create-confirm',
+ listeners: {'tap': 'onTap_'},
- behaviors: [
- I18nBehavior
- ],
+ /** @override */
+ created: function() {
+ this.browserProxy_ = signin.ProfileBrowserProxyImpl.getInstance();
+ },
- properties: {
/**
- * Profile Info of the supervised user that is passed to the page.
- * @type {?ProfileInfo}
+ * Handles tap events from dynamically created links in the
+ * supervisedUserCreatedText i18n string.
+ * @param {!Event} event
+ * @private
*/
- profileInfo: {
- type: Object,
- value: function() { return null; }
+ onTap_: function(event) {
+ var element = Polymer.dom(event).rootTarget;
+
+ // Handle the tap event only if the target is a '<a>' element.
+ if (element.nodeName == 'A') {
+ this.browserProxy_.openUrlInLastActiveProfileBrowser(element.href);
+ event.preventDefault();
+ }
},
- /** @private {!signin.ProfileBrowserProxy} */
- browserProxy_: Object
- },
-
- listeners: {
- 'tap': 'onTap_'
- },
-
- /** @override */
- created: function() {
- this.browserProxy_ = signin.ProfileBrowserProxyImpl.getInstance();
- },
-
- /**
- * Handles tap events from dynamically created links in the
- * supervisedUserCreatedText i18n string.
- * @param {!Event} event
- * @private
- */
- onTap_: function(event) {
- var element = Polymer.dom(event).rootTarget;
-
- // Handle the tap event only if the target is a '<a>' element.
- if (element.nodeName == 'A') {
- this.browserProxy_.openUrlInLastActiveProfileBrowser(element.href);
- event.preventDefault();
- }
- },
-
- /**
+ /**
* Returns the shortened profile name or empty string if |profileInfo| is
* null.
* @param {?ProfileInfo} profileInfo
* @return {string}
* @private
*/
- elideProfileName_: function(profileInfo) {
- var name = profileInfo ? profileInfo.name : '';
- return elide(name, MAX_NAME_LENGTH);
- },
+ elideProfileName_: function(profileInfo) {
+ var name = profileInfo ? profileInfo.name : '';
+ return elide(name, MAX_NAME_LENGTH);
+ },
- /**
+ /**
* Returns the shortened custodian username or empty string if |profileInfo|
* is null.
* @param {?ProfileInfo} profileInfo
* @return {string}
* @private
*/
- elideCustodianUsername_: function(profileInfo) {
- var name = profileInfo ? profileInfo.custodianUsername : '';
- return elide(name, MAX_NAME_LENGTH);
- },
+ elideCustodianUsername_: function(profileInfo) {
+ var name = profileInfo ? profileInfo.custodianUsername : '';
+ return elide(name, MAX_NAME_LENGTH);
+ },
- /**
+ /**
* Computed binding returning the text of the title section.
* @param {?ProfileInfo} profileInfo
* @return {string}
* @private
*/
- titleText_: function(profileInfo) {
- return this.i18n('supervisedUserCreatedTitle',
- this.elideProfileName_(profileInfo));
- },
+ titleText_: function(profileInfo) {
+ return this.i18n(
+ 'supervisedUserCreatedTitle', this.elideProfileName_(profileInfo));
+ },
- /**
+ /**
* Computed binding returning the sanitized confirmation HTML message that is
* safe to set as innerHTML.
* @param {?ProfileInfo} profileInfo
* @return {string}
* @private
*/
- confirmationMessage_: function(profileInfo) {
- return this.i18n('supervisedUserCreatedText',
- this.elideProfileName_(profileInfo),
- this.elideCustodianUsername_(profileInfo));
- },
+ confirmationMessage_: function(profileInfo) {
+ return this.i18n(
+ 'supervisedUserCreatedText', this.elideProfileName_(profileInfo),
+ this.elideCustodianUsername_(profileInfo));
+ },
- /**
+ /**
* Computed binding returning the text of the 'Switch To User' button.
* @param {?ProfileInfo} profileInfo
* @return {string}
* @private
*/
- switchUserText_: function(profileInfo) {
- return this.i18n('supervisedUserCreatedSwitch',
- this.elideProfileName_(profileInfo));
- },
+ switchUserText_: function(profileInfo) {
+ return this.i18n(
+ 'supervisedUserCreatedSwitch', this.elideProfileName_(profileInfo));
+ },
- /**
- * Handler for the 'Ok' button tap event.
- * @param {!Event} event
- * @private
- */
- onOkTap_: function(event) {
- // Event is caught by user-manager-pages.
- this.fire('change-page', {page: 'user-pods-page'});
- },
+ /**
+ * Handler for the 'Ok' button tap event.
+ * @param {!Event} event
+ * @private
+ */
+ onOkTap_: function(event) {
+ // Event is caught by user-manager-pages.
+ this.fire('change-page', {page: 'user-pods-page'});
+ },
- /**
- * Handler for the 'Switch To User' button tap event.
- * @param {!Event} event
- * @private
- */
- onSwitchUserTap_: function(event) {
- this.browserProxy_.switchToProfile(this.profileInfo.filePath);
- // Event is caught by user-manager-pages.
- this.fire('change-page', {page: 'user-pods-page'});
- }
-});
+ /**
+ * Handler for the 'Switch To User' button tap event.
+ * @param {!Event} event
+ * @private
+ */
+ onSwitchUserTap_: function(event) {
+ this.browserProxy_.switchToProfile(this.profileInfo.filePath);
+ // Event is caught by user-manager-pages.
+ this.fire('change-page', {page: 'user-pods-page'});
+ }
+ });
})();

Powered by Google App Engine
This is Rietveld 408576698