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

Unified Diff: chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc

Issue 659063002: White list of users is updated on show. Supervised users not present on the device are removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 6 years, 2 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 | « chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
index 0e4004792259885dd4529629ac2ccc4d232613b0..a57ae5e12c944ed73125d469651e9d5d478d42aa 100644
--- a/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h"
#include "chrome/grit/generated_resources.h"
+#include "chromeos/login/user_names.h"
#include "chromeos/settings/cros_settings_names.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/web_ui.h"
@@ -57,8 +58,8 @@ void AccountsOptionsHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("unwhitelistUser",
base::Bind(&AccountsOptionsHandler::HandleUnwhitelistUser,
base::Unretained(this)));
- web_ui()->RegisterMessageCallback("whitelistExistingUsers",
- base::Bind(&AccountsOptionsHandler::HandleWhitelistExistingUsers,
+ web_ui()->RegisterMessageCallback("updateWhitelist",
+ base::Bind(&AccountsOptionsHandler::HandleUpdateWhitelist,
base::Unretained(this)));
}
@@ -119,7 +120,7 @@ void AccountsOptionsHandler::HandleUnwhitelistUser(
user_manager::UserManager::Get()->RemoveUser(email, NULL);
}
-void AccountsOptionsHandler::HandleWhitelistExistingUsers(
+void AccountsOptionsHandler::HandleUpdateWhitelist(
const base::ListValue* args) {
DCHECK(args && args->empty());
@@ -135,6 +136,20 @@ void AccountsOptionsHandler::HandleWhitelistExistingUsers(
else
new_list.reset(new base::ListValue);
+ // Remove all supervised users. On the next step only supervised users present
+ // on the device will be added back. Thus not present SU are removed.
+ // No need to remove usual users as they can simply login back.
+ for (size_t i = 0; i < new_list->GetSize(); ++i) {
+ std::string whitelisted_user;
+ new_list->GetString(i, &whitelisted_user);
+ LOG(ERROR) << gaia::ExtractDomainName(whitelisted_user);
+ if (gaia::ExtractDomainName(whitelisted_user) ==
+ chromeos::login::kSupervisedUserDomain) {
+ new_list->Remove(i, NULL);
+ --i;
+ }
+ }
+
const user_manager::UserList& users =
user_manager::UserManager::Get()->GetUsers();
for (user_manager::UserList::const_iterator it = users.begin();
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698