| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/chromeos/accounts_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return; | 122 return; |
| 123 } | 123 } |
| 124 | 124 |
| 125 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::DELETE_PROFILE_SETTINGS); | 125 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::DELETE_PROFILE_SETTINGS); |
| 126 | 126 |
| 127 base::StringValue canonical_email(gaia::CanonicalizeEmail(email)); | 127 base::StringValue canonical_email(gaia::CanonicalizeEmail(email)); |
| 128 if (OwnerSettingsServiceChromeOS* service = | 128 if (OwnerSettingsServiceChromeOS* service = |
| 129 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { | 129 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { |
| 130 service->RemoveFromList(kAccountsPrefUsers, canonical_email); | 130 service->RemoveFromList(kAccountsPrefUsers, canonical_email); |
| 131 } | 131 } |
| 132 user_manager::UserManager::Get()->RemoveUser(email, NULL); | 132 user_manager::UserManager::Get()->RemoveUser(AccountId::FromUserEmail(email), |
| 133 nullptr); |
| 133 } | 134 } |
| 134 | 135 |
| 135 void AccountsOptionsHandler::HandleUpdateWhitelist( | 136 void AccountsOptionsHandler::HandleUpdateWhitelist( |
| 136 const base::ListValue* args) { | 137 const base::ListValue* args) { |
| 137 DCHECK(args && args->empty()); | 138 DCHECK(args && args->empty()); |
| 138 | 139 |
| 139 // Creates one list to set. This is needed because user white list update is | 140 // Creates one list to set. This is needed because user white list update is |
| 140 // asynchronous and sequential. Before previous write comes back, cached list | 141 // asynchronous and sequential. Before previous write comes back, cached list |
| 141 // is stale and should not be used for appending. See http://crbug.com/127215 | 142 // is stale and should not be used for appending. See http://crbug.com/127215 |
| 142 scoped_ptr<base::ListValue> new_list; | 143 scoped_ptr<base::ListValue> new_list; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 169 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); | 170 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); |
| 170 | 171 |
| 171 if (OwnerSettingsServiceChromeOS* service = | 172 if (OwnerSettingsServiceChromeOS* service = |
| 172 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { | 173 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { |
| 173 service->Set(kAccountsPrefUsers, *new_list.get()); | 174 service->Set(kAccountsPrefUsers, *new_list.get()); |
| 174 } | 175 } |
| 175 } | 176 } |
| 176 | 177 |
| 177 } // namespace options | 178 } // namespace options |
| 178 } // namespace chromeos | 179 } // namespace chromeos |
| OLD | NEW |