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

Unified Diff: chrome/browser/ui/webui/supervised_user_internals_message_handler.cc

Issue 1859393002: chrome://supervised-user-internals: handle null AccountTrackerService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy_bleh
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/supervised_user_internals_message_handler.cc
diff --git a/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc b/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc
index ba2bef35e346558827f5f4fdf035ccfaa40e4e4f..89ddaaa09c4bab782c78a9f55b49cefe26752852 100644
--- a/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc
@@ -266,18 +266,20 @@ void SupervisedUserInternalsMessageHandler::SendBasicInfo() {
AccountTrackerService* account_tracker =
AccountTrackerServiceFactory::GetForProfile(profile);
-
- for (const auto& account: account_tracker->GetAccounts()) {
- base::ListValue* section_user = AddSection(section_list.get(),
- "User Information for " + account.full_name);
- AddSectionEntry(section_user, "Account id", account.account_id);
- AddSectionEntry(section_user, "Gaia", account.gaia);
- AddSectionEntry(section_user, "Email", account.email);
- AddSectionEntry(section_user, "Given name", account.given_name);
- AddSectionEntry(section_user, "Hosted domain", account.hosted_domain);
- AddSectionEntry(section_user, "Locale", account.locale);
- AddSectionEntry(section_user, "Is child", account.is_child_account);
- AddSectionEntry(section_user, "Is valid", account.IsValid());
+ // |account_tracker| is null in incognito and guest profiles.
+ if (account_tracker) {
+ for (const auto& account: account_tracker->GetAccounts()) {
+ base::ListValue* section_user = AddSection(section_list.get(),
+ "User Information for " + account.full_name);
+ AddSectionEntry(section_user, "Account id", account.account_id);
+ AddSectionEntry(section_user, "Gaia", account.gaia);
+ AddSectionEntry(section_user, "Email", account.email);
+ AddSectionEntry(section_user, "Given name", account.given_name);
+ AddSectionEntry(section_user, "Hosted domain", account.hosted_domain);
+ AddSectionEntry(section_user, "Locale", account.locale);
+ AddSectionEntry(section_user, "Is child", account.is_child_account);
+ AddSectionEntry(section_user, "Is valid", account.IsValid());
+ }
}
base::DictionaryValue result;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698