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->GetAccountId() == | 173 return user->email() == user_manager::UserManager::Get()->GetOwnerEmail(); |
174 user_manager::UserManager::Get()->GetOwnerAccountId(); | |
175 } | 174 } |
176 | 175 |
177 // static | 176 // static |
178 bool ProfileHelper::IsPrimaryProfile(const Profile* profile) { | 177 bool ProfileHelper::IsPrimaryProfile(const Profile* profile) { |
179 if (!profile) | 178 if (!profile) |
180 return false; | 179 return false; |
181 const user_manager::User* user = | 180 const user_manager::User* user = |
182 ProfileHelper::Get()->GetUserByProfile(profile); | 181 ProfileHelper::Get()->GetUserByProfile(profile); |
183 if (!user) | 182 if (!user) |
184 return false; | 183 return false; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 user_to_profile_for_testing_[user] = profile; | 425 user_to_profile_for_testing_[user] = profile; |
427 } | 426 } |
428 | 427 |
429 // static | 428 // static |
430 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( | 429 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( |
431 const std::string& user_id) { | 430 const std::string& user_id) { |
432 return user_id + kUserIdHashSuffix; | 431 return user_id + kUserIdHashSuffix; |
433 } | 432 } |
434 | 433 |
435 } // namespace chromeos | 434 } // namespace chromeos |
OLD | NEW |