Commit eec3b443 authored by Ramin Halavati's avatar Ramin Halavati Committed by Chromium LUCI CQ

Ignore Guest addition/deletion in profile picker.

Profile picker does not show Guest profiles, it should ignore their
addition or removal.

Bug: 1166076
Change-Id: I60ea43ed5368e163cbed7fa1aa320ea55c726b3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2623211
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842904}
parent 9ca977e3
...@@ -683,6 +683,8 @@ base::Value ProfilePickerHandler::GetProfilesList() { ...@@ -683,6 +683,8 @@ base::Value ProfilePickerHandler::GetProfilesList() {
} }
void ProfilePickerHandler::OnProfileAdded(const base::FilePath& profile_path) { void ProfilePickerHandler::OnProfileAdded(const base::FilePath& profile_path) {
if (profile_path == ProfileManager::GetGuestProfilePath())
return;
size_t number_of_profiles = profiles_order_.size(); size_t number_of_profiles = profiles_order_.size();
profiles_order_[profile_path] = number_of_profiles; profiles_order_[profile_path] = number_of_profiles;
PushProfilesList(); PushProfilesList();
...@@ -692,6 +694,8 @@ void ProfilePickerHandler::OnProfileWasRemoved( ...@@ -692,6 +694,8 @@ void ProfilePickerHandler::OnProfileWasRemoved(
const base::FilePath& profile_path, const base::FilePath& profile_path,
const base::string16& profile_name) { const base::string16& profile_name) {
DCHECK(IsJavascriptAllowed()); DCHECK(IsJavascriptAllowed());
if (profile_path == ProfileManager::GetGuestProfilePath())
return;
size_t index = profiles_order_[profile_path]; size_t index = profiles_order_[profile_path];
profiles_order_.erase(profile_path); profiles_order_.erase(profile_path);
for (auto it : profiles_order_) { for (auto it : profiles_order_) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment