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

Side by Side Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 307483002: Desktop user manager: Adjustments for supervised users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + RTL friendly Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/value_conversions.h" 9 #include "base/value_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h" 12 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 14 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
15 #include "chrome/browser/profiles/profile_info_cache.h" 15 #include "chrome/browser/profiles/profile_info_cache.h"
16 #include "chrome/browser/profiles/profile_info_cache_observer.h" 16 #include "chrome/browser/profiles/profile_info_cache_observer.h"
17 #include "chrome/browser/profiles/profile_manager.h" 17 #include "chrome/browser/profiles/profile_manager.h"
18 #include "chrome/browser/profiles/profile_window.h" 18 #include "chrome/browser/profiles/profile_window.h"
19 #include "chrome/browser/profiles/profiles_state.h" 19 #include "chrome/browser/profiles/profiles_state.h"
20 #include "chrome/browser/signin/local_auth.h" 20 #include "chrome/browser/signin/local_auth.h"
21 #include "chrome/browser/ui/browser_dialogs.h" 21 #include "chrome/browser/ui/browser_dialogs.h"
22 #include "chrome/browser/ui/browser_finder.h" 22 #include "chrome/browser/ui/browser_finder.h"
23 #include "chrome/browser/ui/singleton_tabs.h" 23 #include "chrome/browser/ui/singleton_tabs.h"
24 #include "chrome/common/url_constants.h"
24 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
25 #include "content/public/browser/web_ui.h" 26 #include "content/public/browser/web_ui.h"
26 #include "google_apis/gaia/gaia_auth_fetcher.h" 27 #include "google_apis/gaia/gaia_auth_fetcher.h"
27 #include "google_apis/gaia/gaia_constants.h" 28 #include "google_apis/gaia/gaia_constants.h"
28 #include "grit/browser_resources.h" 29 #include "grit/browser_resources.h"
29 #include "grit/chromium_strings.h" 30 #include "grit/chromium_strings.h"
30 #include "grit/generated_resources.h" 31 #include "grit/generated_resources.h"
31 #include "grit/theme_resources.h" 32 #include "grit/theme_resources.h"
32 #include "third_party/skia/include/core/SkBitmap.h" 33 #include "third_party/skia/include/core/SkBitmap.h"
33 #include "ui/base/l10n/l10n_util.h" 34 #include "ui/base/l10n/l10n_util.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 localized_strings->SetString("removeUser", 501 localized_strings->SetString("removeUser",
501 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON)); 502 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON));
502 localized_strings->SetString("passwordFieldAccessibleName", 503 localized_strings->SetString("passwordFieldAccessibleName",
503 l10n_util::GetStringUTF16(IDS_LOGIN_POD_PASSWORD_FIELD_ACCESSIBLE_NAME)); 504 l10n_util::GetStringUTF16(IDS_LOGIN_POD_PASSWORD_FIELD_ACCESSIBLE_NAME));
504 localized_strings->SetString("bootIntoWallpaper", "off"); 505 localized_strings->SetString("bootIntoWallpaper", "off");
505 506
506 // For AccountPickerScreen, the remove user warning overlay. 507 // For AccountPickerScreen, the remove user warning overlay.
507 localized_strings->SetString("removeUserWarningButtonTitle", 508 localized_strings->SetString("removeUserWarningButtonTitle",
508 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON)); 509 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON));
509 localized_strings->SetString("removeUserWarningText", 510 localized_strings->SetString("removeUserWarningText",
510 l10n_util::GetStringUTF16( 511 l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING));
511 IDS_LOGIN_POD_USER_REMOVE_WARNING)); 512 localized_strings->SetString("removeSupervisedUserWarningText",
513 l10n_util::GetStringFUTF16(
514 IDS_LOGIN_POD_SUPERVISED_USER_REMOVE_WARNING,
515 base::UTF8ToUTF16(chrome::kSupervisedUserManagementDisplayURL)));
512 516
513 // Strings needed for the User Manager tutorial slides. 517 // Strings needed for the User Manager tutorial slides.
514 localized_strings->SetString("tutorialStart", 518 localized_strings->SetString("tutorialStart",
515 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_START)); 519 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_START));
516 localized_strings->SetString("tutorialSkip", 520 localized_strings->SetString("tutorialSkip",
517 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_SKIP)); 521 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_SKIP));
518 localized_strings->SetString("tutorialNext", 522 localized_strings->SetString("tutorialNext",
519 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_NEXT)); 523 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_NEXT));
520 localized_strings->SetString("tutorialDone", 524 localized_strings->SetString("tutorialDone",
521 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_DONE)); 525 l10n_util::GetStringUTF16(IDS_USER_MANAGER_TUTORIAL_DONE));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 bool is_active_user = (profile_path == active_profile_path); 586 bool is_active_user = (profile_path == active_profile_path);
583 587
584 profile_value->SetString( 588 profile_value->SetString(
585 kKeyUsername, info_cache.GetUserNameOfProfileAtIndex(i)); 589 kKeyUsername, info_cache.GetUserNameOfProfileAtIndex(i));
586 profile_value->SetString( 590 profile_value->SetString(
587 kKeyEmailAddress, info_cache.GetUserNameOfProfileAtIndex(i)); 591 kKeyEmailAddress, info_cache.GetUserNameOfProfileAtIndex(i));
588 profile_value->SetString( 592 profile_value->SetString(
589 kKeyDisplayName, info_cache.GetNameOfProfileAtIndex(i)); 593 kKeyDisplayName, info_cache.GetNameOfProfileAtIndex(i));
590 profile_value->SetString(kKeyProfilePath, profile_path.MaybeAsASCII()); 594 profile_value->SetString(kKeyProfilePath, profile_path.MaybeAsASCII());
591 profile_value->SetBoolean(kKeyPublicAccount, false); 595 profile_value->SetBoolean(kKeyPublicAccount, false);
592 profile_value->SetBoolean(kKeyLocallyManagedUser, false); 596 profile_value->SetBoolean(
597 kKeyLocallyManagedUser, info_cache.ProfileIsManagedAtIndex(i));
593 profile_value->SetBoolean(kKeySignedIn, is_active_user); 598 profile_value->SetBoolean(kKeySignedIn, is_active_user);
594 profile_value->SetBoolean( 599 profile_value->SetBoolean(
595 kKeyNeedsSignin, info_cache.ProfileIsSigninRequiredAtIndex(i)); 600 kKeyNeedsSignin, info_cache.ProfileIsSigninRequiredAtIndex(i));
596 profile_value->SetBoolean(kKeyIsOwner, false); 601 profile_value->SetBoolean(kKeyIsOwner, false);
597 profile_value->SetBoolean(kKeyCanRemove, !active_user_is_managed); 602 profile_value->SetBoolean(kKeyCanRemove, !active_user_is_managed);
598 profile_value->SetBoolean(kKeyIsDesktop, true); 603 profile_value->SetBoolean(kKeyIsDesktop, true);
599 profile_value->SetString( 604 profile_value->SetString(
600 kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache)); 605 kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache));
601 606
602 // The row of user pods should display the active user first. 607 // The row of user pods should display the active user first.
(...skipping 26 matching lines...) Expand all
629 } else { 634 } else {
630 web_ui()->CallJavascriptFunction( 635 web_ui()->CallJavascriptFunction(
631 "cr.ui.Oobe.showSignInError", 636 "cr.ui.Oobe.showSignInError",
632 base::FundamentalValue(0), 637 base::FundamentalValue(0),
633 base::StringValue( 638 base::StringValue(
634 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_AUTHENTICATING)), 639 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_AUTHENTICATING)),
635 base::StringValue(""), 640 base::StringValue(""),
636 base::FundamentalValue(0)); 641 base::FundamentalValue(0));
637 } 642 }
638 } 643 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698