OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |