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

Side by Side Diff: chrome/browser/resources/settings/people_page/people_page.js

Issue 1536593004: Settings People Revamp: Implement Chrome Profile name/icon selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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
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.
69 * @private
70 * @param {!string} name
71 * @param {!string} iconUrl
72 */
73 handleProfileInfo_: function(name, iconUrl) {
74 this.profileName = name;
75 this.profileIconUrl = iconUrl;
76 },
77
78 /**
56 * Handler for when the sync state is pushed from settings.SyncPrivateApi. 79 * Handler for when the sync state is pushed from settings.SyncPrivateApi.
57 * @private 80 * @private
58 */ 81 */
59 handleSyncStatusFetched_: function(syncStatus) { 82 handleSyncStatusFetched_: function(syncStatus) {
60 this.syncStatus = syncStatus; 83 this.syncStatus = syncStatus;
61 84
62 // TODO(tommycli): Remove once we figure out how to refactor the sync 85 // TODO(tommycli): Remove once we figure out how to refactor the sync
63 // code to not include HTML in the status messages. 86 // code to not include HTML in the status messages.
64 this.$.syncStatusText.innerHTML = syncStatus.statusText; 87 this.$.syncStatusText.innerHTML = syncStatus.statusText;
65 }, 88 },
66 89
67 /** @private */ 90 /** @private */
68 onActionLinkTap_: function() { 91 onActionLinkTap_: function() {
69 settings.SyncPrivateApi.showSetupUI(); 92 settings.SyncPrivateApi.showSetupUI();
70 }, 93 },
71 94
72 /** @private */ 95 /** @private */
96 onManageProfileTap_: function() {
97 <if expr="not chromeos">
98 this.$.pages.setSubpageChain(['manageProfile']);
99 </if>
100 // TODO(tommycli): Implement ChromeOS version. January 2016.
101 },
102
103 /** @private */
73 onSigninTap_: function() { 104 onSigninTap_: function() {
74 settings.SyncPrivateApi.startSignIn(); 105 settings.SyncPrivateApi.startSignIn();
75 }, 106 },
76 107
77 /** @private */ 108 /** @private */
78 onDisconnectTap_: function() { 109 onDisconnectTap_: function() {
79 this.$.disconnectDialog.open(); 110 this.$.disconnectDialog.open();
80 }, 111 },
81 112
82 /** @private */ 113 /** @private */
(...skipping 29 matching lines...) Expand all
112 143
113 /** 144 /**
114 * @private 145 * @private
115 * @return {boolean} 146 * @return {boolean}
116 */ 147 */
117 isAdvancedSyncSettingsVisible_: function(syncStatus) { 148 isAdvancedSyncSettingsVisible_: function(syncStatus) {
118 return syncStatus && syncStatus.signedIn && !syncStatus.managed && 149 return syncStatus && syncStatus.signedIn && !syncStatus.managed &&
119 syncStatus.syncSystemEnabled; 150 syncStatus.syncSystemEnabled;
120 }, 151 },
121 }); 152 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698