Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 6 * @fileoverview |
| 7 * 'settings-people-page' is the settings page containing sign-in settings. | 7 * 'settings-people-page' is the settings page containing sign-in settings. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 prefs: { | 38 prefs: { |
| 39 type: Object, | 39 type: Object, |
| 40 notify: true, | 40 notify: true, |
| 41 }, | 41 }, |
| 42 | 42 |
| 43 /** | 43 /** |
| 44 * The current sync status, supplied by settings.SyncPrivateApi. | 44 * The current sync status, supplied by settings.SyncPrivateApi. |
| 45 * @type {?settings.SyncStatus} | 45 * @type {?settings.SyncStatus} |
| 46 */ | 46 */ |
| 47 syncStatus: Object, | 47 syncStatus: Object, |
| 48 | |
| 49 /** | |
| 50 * The currently selected profile icon URL. May be a data URL. | |
| 51 */ | |
| 52 profileIconUrl: String, | |
| 53 | |
| 54 /** | |
| 55 * The current profile name. | |
| 56 */ | |
| 57 profileName: String, | |
| 48 }, | 58 }, |
| 49 | 59 |
| 60 /** @override */ | |
| 50 created: function() { | 61 created: function() { |
| 62 settings.SyncPrivateApi.getProfileInfo(this.handleProfileInfo_.bind(this)); | |
| 51 settings.SyncPrivateApi.getSyncStatus( | 63 settings.SyncPrivateApi.getSyncStatus( |
| 52 this.handleSyncStatusFetched_.bind(this)); | 64 this.handleSyncStatusFetched_.bind(this)); |
| 53 }, | 65 }, |
| 54 | 66 |
| 55 /** | 67 /** |
| 68 * Handler for when the profile's icon and name is updated. | |
|
dschuyler
2015/12/22 18:47:48
@param
tommycli
2015/12/22 21:58:33
Done.
| |
| 69 * @private | |
| 70 */ | |
| 71 handleProfileInfo_: function(name, iconUrl) { | |
| 72 this.profileName = name; | |
| 73 this.profileIconUrl = iconUrl; | |
| 74 }, | |
| 75 | |
| 76 /** | |
| 56 * Handler for when the sync state is pushed from settings.SyncPrivateApi. | 77 * Handler for when the sync state is pushed from settings.SyncPrivateApi. |
| 57 * @private | 78 * @private |
| 58 */ | 79 */ |
| 59 handleSyncStatusFetched_: function(syncStatus) { | 80 handleSyncStatusFetched_: function(syncStatus) { |
| 60 this.syncStatus = syncStatus; | 81 this.syncStatus = syncStatus; |
| 61 | 82 |
| 62 // TODO(tommycli): Remove once we figure out how to refactor the sync | 83 // TODO(tommycli): Remove once we figure out how to refactor the sync |
| 63 // code to not include HTML in the status messages. | 84 // code to not include HTML in the status messages. |
| 64 this.$.syncStatusText.innerHTML = syncStatus.statusText; | 85 this.$.syncStatusText.innerHTML = syncStatus.statusText; |
| 65 }, | 86 }, |
| 66 | 87 |
| 67 /** @private */ | 88 /** @private */ |
| 68 onActionLinkTap_: function() { | 89 onActionLinkTap_: function() { |
| 69 settings.SyncPrivateApi.showSetupUI(); | 90 settings.SyncPrivateApi.showSetupUI(); |
| 70 }, | 91 }, |
| 71 | 92 |
| 72 /** @private */ | 93 /** @private */ |
| 94 onManageProfileTap_: function() { | |
| 95 <if expr="not chromeos"> | |
| 96 this.$.pages.setSubpageChain(['manageProfile']); | |
| 97 </if> | |
| 98 // TODO(tommycli): Implement ChromeOS version. January 2016. | |
| 99 }, | |
| 100 | |
| 101 /** @private */ | |
| 73 onSigninTap_: function() { | 102 onSigninTap_: function() { |
| 74 settings.SyncPrivateApi.startSignIn(); | 103 settings.SyncPrivateApi.startSignIn(); |
| 75 }, | 104 }, |
| 76 | 105 |
| 77 /** @private */ | 106 /** @private */ |
| 78 onDisconnectTap_: function() { | 107 onDisconnectTap_: function() { |
| 79 this.$.disconnectDialog.open(); | 108 this.$.disconnectDialog.open(); |
| 80 }, | 109 }, |
| 81 | 110 |
| 82 /** @private */ | 111 /** @private */ |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 112 | 141 |
| 113 /** | 142 /** |
| 114 * @private | 143 * @private |
| 115 * @return {boolean} | 144 * @return {boolean} |
| 116 */ | 145 */ |
| 117 isAdvancedSyncSettingsVisible_: function(syncStatus) { | 146 isAdvancedSyncSettingsVisible_: function(syncStatus) { |
| 118 return syncStatus && syncStatus.signedIn && !syncStatus.managed && | 147 return syncStatus && syncStatus.signedIn && !syncStatus.managed && |
| 119 syncStatus.syncSystemEnabled; | 148 syncStatus.syncSystemEnabled; |
| 120 }, | 149 }, |
| 121 }); | 150 }); |
| OLD | NEW |