OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/webui/signin/user_manager_screen_handler.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/value_conversions.h" | 10 #include "base/value_conversions.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "ash/shell.h" | 51 #include "ash/shell.h" |
52 #endif | 52 #endif |
53 | 53 |
54 namespace { | 54 namespace { |
55 // User dictionary keys. | 55 // User dictionary keys. |
56 const char kKeyUsername[] = "username"; | 56 const char kKeyUsername[] = "username"; |
57 const char kKeyDisplayName[]= "displayName"; | 57 const char kKeyDisplayName[]= "displayName"; |
58 const char kKeyEmailAddress[] = "emailAddress"; | 58 const char kKeyEmailAddress[] = "emailAddress"; |
59 const char kKeyProfilePath[] = "profilePath"; | 59 const char kKeyProfilePath[] = "profilePath"; |
60 const char kKeyPublicAccount[] = "publicAccount"; | 60 const char kKeyPublicAccount[] = "publicAccount"; |
61 const char kKeySupervisedUser[] = "supervisedUser"; | 61 const char kKeyLegacySupervisedUser[] = "legacySupervisedUser"; |
62 const char kKeyChildUser[] = "childUser"; | 62 const char kKeyChildUser[] = "childUser"; |
63 const char kKeyCanRemove[] = "canRemove"; | 63 const char kKeyCanRemove[] = "canRemove"; |
64 const char kKeyIsOwner[] = "isOwner"; | 64 const char kKeyIsOwner[] = "isOwner"; |
65 const char kKeyIsDesktop[] = "isDesktopUser"; | 65 const char kKeyIsDesktop[] = "isDesktopUser"; |
66 const char kKeyAvatarUrl[] = "userImage"; | 66 const char kKeyAvatarUrl[] = "userImage"; |
67 const char kKeyNeedsSignin[] = "needsSignin"; | 67 const char kKeyNeedsSignin[] = "needsSignin"; |
68 | 68 |
69 // JS API callback names. | 69 // JS API callback names. |
70 const char kJsApiUserManagerInitialize[] = "userManagerInitialize"; | 70 const char kJsApiUserManagerInitialize[] = "userManagerInitialize"; |
71 const char kJsApiUserManagerAddUser[] = "addUser"; | 71 const char kJsApiUserManagerAddUser[] = "addUser"; |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON)); | 634 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON)); |
635 localized_strings->SetString("passwordFieldAccessibleName", | 635 localized_strings->SetString("passwordFieldAccessibleName", |
636 l10n_util::GetStringUTF16(IDS_LOGIN_POD_PASSWORD_FIELD_ACCESSIBLE_NAME)); | 636 l10n_util::GetStringUTF16(IDS_LOGIN_POD_PASSWORD_FIELD_ACCESSIBLE_NAME)); |
637 localized_strings->SetString("bootIntoWallpaper", "off"); | 637 localized_strings->SetString("bootIntoWallpaper", "off"); |
638 | 638 |
639 // For AccountPickerScreen, the remove user warning overlay. | 639 // For AccountPickerScreen, the remove user warning overlay. |
640 localized_strings->SetString("removeUserWarningButtonTitle", | 640 localized_strings->SetString("removeUserWarningButtonTitle", |
641 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON)); | 641 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON)); |
642 localized_strings->SetString("removeUserWarningText", | 642 localized_strings->SetString("removeUserWarningText", |
643 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING)); | 643 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING)); |
644 localized_strings->SetString("removeSupervisedUserWarningText", | 644 localized_strings->SetString("removeLegacySupervisedUserWarningText", |
645 l10n_util::GetStringFUTF16( | 645 l10n_util::GetStringFUTF16( |
646 IDS_LOGIN_POD_SUPERVISED_USER_REMOVE_WARNING, | 646 IDS_LOGIN_POD_LEGACY_SUPERVISED_USER_REMOVE_WARNING, |
647 base::UTF8ToUTF16(chrome::kSupervisedUserManagementDisplayURL))); | 647 base::UTF8ToUTF16(chrome::kSupervisedUserManagementDisplayURL))); |
648 | 648 |
649 // Strings needed for the User Manager tutorial slides. | 649 // Strings needed for the User Manager tutorial slides. |
650 localized_strings->SetString("tutorialNext", | 650 localized_strings->SetString("tutorialNext", |
651 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_NEXT)); | 651 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_NEXT)); |
652 localized_strings->SetString("tutorialDone", | 652 localized_strings->SetString("tutorialDone", |
653 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_DONE)); | 653 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_DONE)); |
654 localized_strings->SetString("slideWelcomeTitle", | 654 localized_strings->SetString("slideWelcomeTitle", |
655 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_SLIDE_INTRO_TITLE)); | 655 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_SLIDE_INTRO_TITLE)); |
656 localized_strings->SetString("slideWelcomeText", | 656 localized_strings->SetString("slideWelcomeText", |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 profile_value->SetString( | 720 profile_value->SetString( |
721 kKeyUsername, info_cache.GetUserNameOfProfileAtIndex(i)); | 721 kKeyUsername, info_cache.GetUserNameOfProfileAtIndex(i)); |
722 profile_value->SetString( | 722 profile_value->SetString( |
723 kKeyEmailAddress, info_cache.GetUserNameOfProfileAtIndex(i)); | 723 kKeyEmailAddress, info_cache.GetUserNameOfProfileAtIndex(i)); |
724 profile_value->SetString( | 724 profile_value->SetString( |
725 kKeyDisplayName, | 725 kKeyDisplayName, |
726 profiles::GetAvatarNameForProfile(profile_path)); | 726 profiles::GetAvatarNameForProfile(profile_path)); |
727 profile_value->Set( | 727 profile_value->Set( |
728 kKeyProfilePath, base::CreateFilePathValue(profile_path)); | 728 kKeyProfilePath, base::CreateFilePathValue(profile_path)); |
729 profile_value->SetBoolean(kKeyPublicAccount, false); | 729 profile_value->SetBoolean(kKeyPublicAccount, false); |
730 profile_value->SetBoolean( | 730 profile_value->SetBoolean(kKeyLegacySupervisedUser, |
731 kKeySupervisedUser, info_cache.ProfileIsLegacySupervisedAtIndex(i)); | 731 info_cache.ProfileIsLegacySupervisedAtIndex(i)); |
732 profile_value->SetBoolean( | 732 profile_value->SetBoolean( |
733 kKeyChildUser, info_cache.ProfileIsChildAtIndex(i)); | 733 kKeyChildUser, info_cache.ProfileIsChildAtIndex(i)); |
734 profile_value->SetBoolean( | 734 profile_value->SetBoolean( |
735 kKeyNeedsSignin, info_cache.ProfileIsSigninRequiredAtIndex(i)); | 735 kKeyNeedsSignin, info_cache.ProfileIsSigninRequiredAtIndex(i)); |
736 profile_value->SetBoolean(kKeyIsOwner, false); | 736 profile_value->SetBoolean(kKeyIsOwner, false); |
737 profile_value->SetBoolean(kKeyCanRemove, can_remove); | 737 profile_value->SetBoolean(kKeyCanRemove, can_remove); |
738 profile_value->SetBoolean(kKeyIsDesktop, true); | 738 profile_value->SetBoolean(kKeyIsDesktop, true); |
739 profile_value->SetString( | 739 profile_value->SetString( |
740 kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache)); | 740 kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache)); |
741 | 741 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 Profile* profile, Profile::CreateStatus profile_create_status) { | 828 Profile* profile, Profile::CreateStatus profile_create_status) { |
829 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); | 829 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); |
830 if (browser && browser->window()) { | 830 if (browser && browser->window()) { |
831 OnBrowserWindowReady(browser); | 831 OnBrowserWindowReady(browser); |
832 } else { | 832 } else { |
833 registrar_.Add(this, | 833 registrar_.Add(this, |
834 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 834 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
835 content::NotificationService::AllSources()); | 835 content::NotificationService::AllSources()); |
836 } | 836 } |
837 } | 837 } |
OLD | NEW |