Skip to content

Commit

Permalink
Add more parameters from ProfileAttributesEntry to ProfileState in pr…
Browse files Browse the repository at this point in the history
…ofile-internals

Bug: 1313447
Change-Id: If1754fad73c6726cab1cafa47530b0172dd6a588
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3644730
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Gabriel Oliveira <gabolvr@google.com>
Cr-Commit-Position: refs/heads/main@{#1002650}
  • Loading branch information
Gabriel Oliveira authored and Chromium LUCI CQ committed May 12, 2022
1 parent 69b3b9b commit 00b1e1b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
tr:nth-child(odd) {
background: rgb(239, 243, 255);
}

ul {
list-style-type: none;
margin: 0;
padding: 0;
}
</style>
<h2>Profiles</h2>\
<template is="dom-repeat" items="[[profilesList_]]">
Expand Down Expand Up @@ -42,6 +48,22 @@ <h2>Profiles</h2>\
<td>Hosted Domain</td>
<td>[[item.profileState.hostedDomain]]</td>
</tr>
<tr>
<td>Supervised</td>
<td>[[item.profileState.isSupervised]]</td>
</tr>
<tr>
<td>Omitted</td>
<td>[[item.profileState.isOmitted]]</td>
</tr>
<tr>
<td>Ephemeral</td>
<td>[[item.profileState.isEphemeral]]</td>
</tr>
<tr>
<td>User Accepted Account Management</td>
<td>[[item.profileState.userAcceptedAccountManagement]]</td>
</tr>
<tr>
<td>KeepAlives</td>
<td>
Expand All @@ -55,6 +77,17 @@ <h2>Profiles</h2>\
</table>
</td>
</tr>
<tr>
<td>Signed Accounts</td>
<td>
<ul>
<template is="dom-repeat"
items="[[item.profileState.signedAccounts]]">
<li>[[item]]</li>
</template>
</ul>
</td>
</tr>
</table>
</iron-collapse>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export type ProfileState = {
gaiaId: string,
userName: string,
hostedDomain: string,
isSupervised: boolean,
isOmitted: boolean,
isEphemeral: boolean,
userAcceptedAccountManagement: boolean,
keepAlives: Array<KeepAlive>,
signedAccounts: Array<string>,
};

export type ProfileStateElement = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "chrome/browser/ui/webui/profile_internals/profile_internals_handler.h"

#include "base/bind.h"
#include "base/containers/flat_set.h"
#include "base/json/values_util.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
Expand Down Expand Up @@ -41,6 +42,11 @@ base::Value CreateProfileEntry(const ProfileAttributesEntry* entry) {
profile_entry.SetStringKey("gaiaId", entry->GetGAIAId());
profile_entry.SetStringKey("userName", entry->GetUserName());
profile_entry.SetStringKey("hostedDomain", entry->GetHostedDomain());
profile_entry.SetBoolKey("isSupervised", entry->IsSupervised());
profile_entry.SetBoolKey("isOmitted", entry->IsOmitted());
profile_entry.SetBoolKey("isEphemeral", entry->IsEphemeral());
profile_entry.SetBoolKey("userAcceptedAccountManagement",
entry->UserAcceptedAccountManagement());

base::Value keep_alives(base::Value::Type::LIST);
std::map<ProfileKeepAliveOrigin, int> keep_alives_map =
Expand All @@ -58,6 +64,12 @@ base::Value CreateProfileEntry(const ProfileAttributesEntry* entry) {
}
profile_entry.SetKey("keepAlives", std::move(keep_alives));

base::Value signedAccounts(base::Value::Type::LIST);
for (const std::string& gaiaId : entry->GetGaiaIds()) {
signedAccounts.Append(gaiaId);
}
profile_entry.SetKey("signedAccounts", std::move(signedAccounts));

return profile_entry;
}

Expand Down

0 comments on commit 00b1e1b

Please sign in to comment.