| OLD | NEW |
| 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 /** | 5 /** |
| 6 * @fileoverview User pod row implementation. | 6 * @fileoverview User pod row implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 /** | 10 /** |
| (...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 for (var key in stats_elements) { | 1769 for (var key in stats_elements) { |
| 1770 if (this.user.statistics[key].success) { | 1770 if (this.user.statistics[key].success) { |
| 1771 var count = this.user.statistics[key].count; | 1771 var count = this.user.statistics[key].count; |
| 1772 stats_elements[key].textContent = count; | 1772 stats_elements[key].textContent = count; |
| 1773 total_count += count; | 1773 total_count += count; |
| 1774 num_stats_loaded++; | 1774 num_stats_loaded++; |
| 1775 } | 1775 } |
| 1776 } | 1776 } |
| 1777 | 1777 |
| 1778 // this.classList is used for selecting the appropriate dialog. | 1778 // this.classList is used for selecting the appropriate dialog. |
| 1779 if (total_count) | 1779 this.classList.remove('has-no-stats'); |
| 1780 this.classList.remove('has-no-stats'); | |
| 1781 | 1780 |
| 1782 var is_synced_user = this.user.emailAddress !== ""; | 1781 var is_synced_user = this.user.emailAddress !== ""; |
| 1783 // Write total number if all statistics are loaded. | 1782 // Write total number if all statistics are loaded. |
| 1784 if (num_stats_loaded === Object.keys(stats_elements).length) { | 1783 if (num_stats_loaded === Object.keys(stats_elements).length) { |
| 1785 if (!total_count) { | 1784 if (!total_count) { |
| 1786 this.classList.add('has-no-stats'); | |
| 1787 var message = loadTimeData.getString( | 1785 var message = loadTimeData.getString( |
| 1788 is_synced_user ? 'removeUserWarningTextSyncNoStats' : | 1786 is_synced_user ? 'removeUserWarningTextSyncNoStats' : |
| 1789 'removeUserWarningTextNonSyncNoStats'); | 1787 'removeUserWarningTextNonSyncNoStats'); |
| 1790 this.updateRemoveWarningDialogSetMessage_(this.user.profilePath, | 1788 this.updateRemoveWarningDialogSetMessage_(this.user.profilePath, |
| 1791 message); | 1789 message); |
| 1792 } else { | 1790 } else { |
| 1793 window.updateRemoveWarningDialogSetMessage = | 1791 window.updateRemoveWarningDialogSetMessage = |
| 1794 this.updateRemoveWarningDialogSetMessage_.bind(this); | 1792 this.updateRemoveWarningDialogSetMessage_.bind(this); |
| 1795 chrome.send('getRemoveWarningDialogMessage',[{ | 1793 chrome.send('getRemoveWarningDialogMessage',[{ |
| 1796 profilePath: this.user.profilePath, | 1794 profilePath: this.user.profilePath, |
| (...skipping 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3987 if (pod && pod.multiProfilesPolicyApplied) { | 3985 if (pod && pod.multiProfilesPolicyApplied) { |
| 3988 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3986 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3989 } | 3987 } |
| 3990 } | 3988 } |
| 3991 }; | 3989 }; |
| 3992 | 3990 |
| 3993 return { | 3991 return { |
| 3994 PodRow: PodRow | 3992 PodRow: PodRow |
| 3995 }; | 3993 }; |
| 3996 }); | 3994 }); |
| OLD | NEW |