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(AccountId::FromUserEmail(email), | 132 user_manager::UserManager::Get()->RemoveUser(email, NULL); |
133 nullptr); | |
134 } | 133 } |
135 | 134 |
136 void AccountsOptionsHandler::HandleUpdateWhitelist( | 135 void AccountsOptionsHandler::HandleUpdateWhitelist( |
137 const base::ListValue* args) { | 136 const base::ListValue* args) { |
138 DCHECK(args && args->empty()); | 137 DCHECK(args && args->empty()); |
139 | 138 |
140 // Creates one list to set. This is needed because user white list update is | 139 // Creates one list to set. This is needed because user white list update is |
141 // asynchronous and sequential. Before previous write comes back, cached list | 140 // asynchronous and sequential. Before previous write comes back, cached list |
142 // is stale and should not be used for appending. See http://crbug.com/127215 | 141 // is stale and should not be used for appending. See http://crbug.com/127215 |
143 scoped_ptr<base::ListValue> new_list; | 142 scoped_ptr<base::ListValue> new_list; |
(...skipping 26 matching lines...) Expand all Loading... |
170 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); | 169 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); |
171 | 170 |
172 if (OwnerSettingsServiceChromeOS* service = | 171 if (OwnerSettingsServiceChromeOS* service = |
173 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { | 172 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { |
174 service->Set(kAccountsPrefUsers, *new_list.get()); | 173 service->Set(kAccountsPrefUsers, *new_list.get()); |
175 } | 174 } |
176 } | 175 } |
177 | 176 |
178 } // namespace options | 177 } // namespace options |
179 } // namespace chromeos | 178 } // namespace chromeos |
OLD | NEW |