| 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( | 173 user_manager::UserManager::Get()->RemoveUser(parameters->email, NULL); |
| 174 AccountId::FromUserEmail(parameters->email), NULL); | |
| 175 return RespondNow(OneArgument(new base::FundamentalValue(removed))); | 174 return RespondNow(OneArgument(new base::FundamentalValue(removed))); |
| 176 } | 175 } |
| 177 | 176 |
| 178 //////////////////////////////////////////////////////////////////////////////// | 177 //////////////////////////////////////////////////////////////////////////////// |
| 179 // UsersPrivateIsCurrentUserOwnerFunction | 178 // UsersPrivateIsCurrentUserOwnerFunction |
| 180 | 179 |
| 181 UsersPrivateIsCurrentUserOwnerFunction::UsersPrivateIsCurrentUserOwnerFunction() | 180 UsersPrivateIsCurrentUserOwnerFunction::UsersPrivateIsCurrentUserOwnerFunction() |
| 182 : chrome_details_(this) { | 181 : chrome_details_(this) { |
| 183 } | 182 } |
| 184 | 183 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 206 | 205 |
| 207 ExtensionFunction::ResponseAction | 206 ExtensionFunction::ResponseAction |
| 208 UsersPrivateIsWhitelistManagedFunction::Run() { | 207 UsersPrivateIsWhitelistManagedFunction::Run() { |
| 209 bool is_managed = g_browser_process->platform_part() | 208 bool is_managed = g_browser_process->platform_part() |
| 210 ->browser_policy_connector_chromeos() | 209 ->browser_policy_connector_chromeos() |
| 211 ->IsEnterpriseManaged(); | 210 ->IsEnterpriseManaged(); |
| 212 return RespondNow(OneArgument(new base::FundamentalValue(is_managed))); | 211 return RespondNow(OneArgument(new base::FundamentalValue(is_managed))); |
| 213 } | 212 } |
| 214 | 213 |
| 215 } // namespace extensions | 214 } // namespace extensions |
| OLD | NEW |