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

Side by Side Diff: chrome/browser/sync/sync_ui_util.cc

Issue 2267013002: [MD User Menu] New way to handle supervised user auth error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/sync/sync_ui_util.h" 5 #include "chrome/browser/sync/sync_ui_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 *content_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_AGAIN_MESSAGE; 430 *content_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_AGAIN_MESSAGE;
431 *button_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_AGAIN_BUTTON; 431 *button_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_AGAIN_BUTTON;
432 return UNRECOVERABLE_ERROR; 432 return UNRECOVERABLE_ERROR;
433 } 433 }
434 } 434 }
435 435
436 // Check for an auth error. 436 // Check for an auth error.
437 SigninErrorController* signin_error_controller = 437 SigninErrorController* signin_error_controller =
438 SigninErrorControllerFactory::GetForProfile(profile); 438 SigninErrorControllerFactory::GetForProfile(profile);
439 if (signin_error_controller && signin_error_controller->HasError()) { 439 if (signin_error_controller && signin_error_controller->HasError()) {
440 if (profile->IsSupervised()) {
441 // For a supervised user, no direct action can be taken to resolve an
442 // auth token error.
443 *content_string_id = IDS_SYNC_ERROR_USER_MENU_SUPERVISED_SIGNIN_MESSAGE;
444 *button_string_id = 0;
445 return SUPERVISED_USER_AUTH_ERROR;
446 }
447 // For a non-supervised user, the user can reauth to resolve the signin
448 // error.
440 *content_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_MESSAGE; 449 *content_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_MESSAGE;
441 *button_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_BUTTON; 450 *button_string_id = IDS_SYNC_ERROR_USER_MENU_SIGNIN_BUTTON;
442 return AUTH_ERROR; 451 return AUTH_ERROR;
443 } 452 }
444 453
445 // Check for sync errors if the sync service is enabled. 454 // Check for sync errors if the sync service is enabled.
446 if (service) { 455 if (service) {
447 // Check for an actionable UPGRADE_CLIENT error. 456 // Check for an actionable UPGRADE_CLIENT error.
448 ProfileSyncService::Status status; 457 ProfileSyncService::Status status;
449 service->QueryDetailedSyncStatus(&status); 458 service->QueryDetailedSyncStatus(&status);
(...skipping 28 matching lines...) Expand all
478 base::string16 ConstructTime(int64_t time_in_int) { 487 base::string16 ConstructTime(int64_t time_in_int) {
479 base::Time time = base::Time::FromInternalValue(time_in_int); 488 base::Time time = base::Time::FromInternalValue(time_in_int);
480 489
481 // If time is null the format function returns a time in 1969. 490 // If time is null the format function returns a time in 1969.
482 if (time.is_null()) 491 if (time.is_null())
483 return base::string16(); 492 return base::string16();
484 return base::TimeFormatFriendlyDateAndTime(time); 493 return base::TimeFormatFriendlyDateAndTime(time);
485 } 494 }
486 495
487 } // namespace sync_ui_util 496 } // namespace sync_ui_util
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_ui_util.h ('k') | chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698