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

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

Issue 2614883004: [MD Settings] Fixes the crash when navigating directly to chrome://md-settings/signOut (Closed)
Patch Set: fixed cros tests 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Polymer({ 9 Polymer({
10 is: 'settings-people-page', 10 is: 'settings-people-page',
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 </if> 174 </if>
175 }, 175 },
176 176
177 /** @protected */ 177 /** @protected */
178 currentRouteChanged: function() { 178 currentRouteChanged: function() {
179 this.showImportDataDialog_ = 179 this.showImportDataDialog_ =
180 settings.getCurrentRoute() == settings.Route.IMPORT_DATA; 180 settings.getCurrentRoute() == settings.Route.IMPORT_DATA;
181 181
182 if (settings.getCurrentRoute() == settings.Route.SIGN_OUT) { 182 if (settings.getCurrentRoute() == settings.Route.SIGN_OUT) {
183 // Request the latest profile stats count, but don't wait for it.
184 settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileStatsCount();
185
186 // If the sync status has not been fetched yet, optimistically display 183 // If the sync status has not been fetched yet, optimistically display
187 // the disconnect dialog. There is another check when the sync status is 184 // the disconnect dialog. There is another check when the sync status is
188 // fetched. The dialog will be closed then the user is not signed in. 185 // fetched. The dialog will be closed then the user is not signed in.
189 if (this.syncStatus && !this.syncStatus.signedIn) 186 if (this.syncStatus && !this.syncStatus.signedIn)
190 settings.navigateToPreviousRoute(); 187 settings.navigateToPreviousRoute();
191 else 188 else
192 this.$.disconnectDialog.showModal(); 189 this.$.disconnectDialog.showModal();
193 } else if (this.$.disconnectDialog.open) { 190 } else if (this.$.disconnectDialog.open) {
194 this.$.disconnectDialog.close(); 191 this.$.disconnectDialog.close();
195 } 192 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 240
244 /** 241 /**
245 * Handler for when the sync state is pushed from the browser. 242 * Handler for when the sync state is pushed from the browser.
246 * @param {?settings.SyncStatus} syncStatus 243 * @param {?settings.SyncStatus} syncStatus
247 * @private 244 * @private
248 */ 245 */
249 handleSyncStatus_: function(syncStatus) { 246 handleSyncStatus_: function(syncStatus) {
250 if (!this.syncStatus && syncStatus && !syncStatus.signedIn) 247 if (!this.syncStatus && syncStatus && !syncStatus.signedIn)
251 chrome.metricsPrivate.recordUserAction('Signin_Impression_FromSettings'); 248 chrome.metricsPrivate.recordUserAction('Signin_Impression_FromSettings');
252 249
250 <if expr="not chromeos">
251 if (syncStatus.signedIn)
252 settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileStatsCount();
253 </if>
254
253 if (!syncStatus.signedIn && this.$.disconnectDialog.open) 255 if (!syncStatus.signedIn && this.$.disconnectDialog.open)
254 this.$.disconnectDialog.close(); 256 this.$.disconnectDialog.close();
255 257
256 this.syncStatus = syncStatus; 258 this.syncStatus = syncStatus;
257 }, 259 },
258 260
259 <if expr="chromeos"> 261 <if expr="chromeos">
260 /** 262 /**
261 * Handler for when the Easy Unlock enabled status has changed. 263 * Handler for when the Easy Unlock enabled status has changed.
262 * @private 264 * @private
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 510
509 /** 511 /**
510 * @param {!settings.SyncStatus} syncStatus 512 * @param {!settings.SyncStatus} syncStatus
511 * @return {boolean} Whether to show the "Sign in to Chrome" button. 513 * @return {boolean} Whether to show the "Sign in to Chrome" button.
512 * @private 514 * @private
513 */ 515 */
514 showSignin_: function(syncStatus) { 516 showSignin_: function(syncStatus) {
515 return !!syncStatus.signinAllowed && !syncStatus.signedIn; 517 return !!syncStatus.signinAllowed && !syncStatus.signedIn;
516 }, 518 },
517 }); 519 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/profile_info_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698