OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/extensions/users_private/users_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/users_private/users_private_api.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/extensions/users_private/users_private_delegat
e.h" | 9 #include "chrome/browser/chromeos/extensions/users_private/users_private_delegat
e.h" |
10 #include "chrome/browser/chromeos/extensions/users_private/users_private_delegat
e_factory.h" | 10 #include "chrome/browser/chromeos/extensions/users_private/users_private_delegat
e_factory.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return RespondNow(OneArgument(new base::FundamentalValue(false))); | 163 return RespondNow(OneArgument(new base::FundamentalValue(false))); |
164 } | 164 } |
165 | 165 |
166 base::StringValue canonical_email(gaia::CanonicalizeEmail(parameters->email)); | 166 base::StringValue canonical_email(gaia::CanonicalizeEmail(parameters->email)); |
167 | 167 |
168 UsersPrivateDelegate* delegate = | 168 UsersPrivateDelegate* delegate = |
169 UsersPrivateDelegateFactory::GetForBrowserContext(browser_context()); | 169 UsersPrivateDelegateFactory::GetForBrowserContext(browser_context()); |
170 PrefsUtil* prefs_util = delegate->GetPrefsUtil(); | 170 PrefsUtil* prefs_util = delegate->GetPrefsUtil(); |
171 bool removed = prefs_util->RemoveFromListCrosSetting( | 171 bool removed = prefs_util->RemoveFromListCrosSetting( |
172 chromeos::kAccountsPrefUsers, canonical_email); | 172 chromeos::kAccountsPrefUsers, canonical_email); |
173 user_manager::UserManager::Get()->RemoveUser(parameters->email, NULL); | 173 user_manager::UserManager::Get()->RemoveUser( |
| 174 AccountId::FromUserEmail(parameters->email), NULL); |
174 return RespondNow(OneArgument(new base::FundamentalValue(removed))); | 175 return RespondNow(OneArgument(new base::FundamentalValue(removed))); |
175 } | 176 } |
176 | 177 |
177 //////////////////////////////////////////////////////////////////////////////// | 178 //////////////////////////////////////////////////////////////////////////////// |
178 // UsersPrivateIsCurrentUserOwnerFunction | 179 // UsersPrivateIsCurrentUserOwnerFunction |
179 | 180 |
180 UsersPrivateIsCurrentUserOwnerFunction::UsersPrivateIsCurrentUserOwnerFunction() | 181 UsersPrivateIsCurrentUserOwnerFunction::UsersPrivateIsCurrentUserOwnerFunction() |
181 : chrome_details_(this) { | 182 : chrome_details_(this) { |
182 } | 183 } |
183 | 184 |
(...skipping 21 matching lines...) Expand all Loading... |
205 | 206 |
206 ExtensionFunction::ResponseAction | 207 ExtensionFunction::ResponseAction |
207 UsersPrivateIsWhitelistManagedFunction::Run() { | 208 UsersPrivateIsWhitelistManagedFunction::Run() { |
208 bool is_managed = g_browser_process->platform_part() | 209 bool is_managed = g_browser_process->platform_part() |
209 ->browser_policy_connector_chromeos() | 210 ->browser_policy_connector_chromeos() |
210 ->IsEnterpriseManaged(); | 211 ->IsEnterpriseManaged(); |
211 return RespondNow(OneArgument(new base::FundamentalValue(is_managed))); | 212 return RespondNow(OneArgument(new base::FundamentalValue(is_managed))); |
212 } | 213 } |
213 | 214 |
214 } // namespace extensions | 215 } // namespace extensions |
OLD | NEW |