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

Side by Side Diff: chrome/browser/chromeos/profiles/profile_helper.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: Fix Win GN build. 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/profiles/profile_helper.h" 5 #include "chrome/browser/chromeos/profiles/profile_helper.h"
6 6
7 #include "base/barrier_closure.h" 7 #include "base/barrier_closure.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 chromeos::switches::kStubCrosSettings)) { 163 chromeos::switches::kStubCrosSettings)) {
164 return true; 164 return true;
165 } 165 }
166 166
167 if (!profile) 167 if (!profile)
168 return false; 168 return false;
169 const user_manager::User* user = 169 const user_manager::User* user =
170 ProfileHelper::Get()->GetUserByProfile(profile); 170 ProfileHelper::Get()->GetUserByProfile(profile);
171 if (!user) 171 if (!user)
172 return false; 172 return false;
173 return user->email() == user_manager::UserManager::Get()->GetOwnerEmail(); 173 return user->GetAccountId() ==
174 user_manager::UserManager::Get()->GetOwnerAccountId();
174 } 175 }
175 176
176 // static 177 // static
177 bool ProfileHelper::IsPrimaryProfile(const Profile* profile) { 178 bool ProfileHelper::IsPrimaryProfile(const Profile* profile) {
178 if (!profile) 179 if (!profile)
179 return false; 180 return false;
180 const user_manager::User* user = 181 const user_manager::User* user =
181 ProfileHelper::Get()->GetUserByProfile(profile); 182 ProfileHelper::Get()->GetUserByProfile(profile);
182 if (!user) 183 if (!user)
183 return false; 184 return false;
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 user_to_profile_for_testing_[user] = profile; 426 user_to_profile_for_testing_[user] = profile;
426 } 427 }
427 428
428 // static 429 // static
429 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( 430 std::string ProfileHelper::GetUserIdHashByUserIdForTesting(
430 const std::string& user_id) { 431 const std::string& user_id) {
431 return user_id + kUserIdHashSuffix; 432 return user_id + kUserIdHashSuffix;
432 } 433 }
433 434
434 } // namespace chromeos 435 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698