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

Side by Side Diff: chrome/browser/chromeos/extensions/users_private/users_private_api.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Update after review. Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698