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/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 base::FilePath ProfileHelper::GetUserProfileDir( | 134 base::FilePath ProfileHelper::GetUserProfileDir( |
135 const std::string& user_id_hash) { | 135 const std::string& user_id_hash) { |
136 CHECK(!user_id_hash.empty()); | 136 CHECK(!user_id_hash.empty()); |
137 return ShouldAddProfileDirPrefix(user_id_hash) | 137 return ShouldAddProfileDirPrefix(user_id_hash) |
138 ? base::FilePath(chrome::kProfileDirPrefix + user_id_hash) | 138 ? base::FilePath(chrome::kProfileDirPrefix + user_id_hash) |
139 : base::FilePath(user_id_hash); | 139 : base::FilePath(user_id_hash); |
140 } | 140 } |
141 | 141 |
142 // static | 142 // static |
143 bool ProfileHelper::IsSigninProfile(const Profile* profile) { | 143 bool ProfileHelper::IsSigninProfile(const Profile* profile) { |
144 return profile->GetPath().BaseName().value() == chrome::kInitialProfile; | 144 return profile && |
mtomasz
2015/02/26 04:27:50
nit: Passing null doesn't make sense. Can we add a
Ivan Podogov
2015/02/26 11:02:08
I looked at the functions above and below this one
| |
145 profile->GetPath().BaseName().value() == chrome::kInitialProfile; | |
145 } | 146 } |
146 | 147 |
147 // static | 148 // static |
148 bool ProfileHelper::IsOwnerProfile(Profile* profile) { | 149 bool ProfileHelper::IsOwnerProfile(Profile* profile) { |
149 if (!profile) | 150 if (!profile) |
150 return false; | 151 return false; |
151 const user_manager::User* user = | 152 const user_manager::User* user = |
152 ProfileHelper::Get()->GetUserByProfile(profile); | 153 ProfileHelper::Get()->GetUserByProfile(profile); |
153 if (!user) | 154 if (!user) |
154 return false; | 155 return false; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 user_to_profile_for_testing_[user] = profile; | 383 user_to_profile_for_testing_[user] = profile; |
383 } | 384 } |
384 | 385 |
385 // static | 386 // static |
386 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( | 387 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( |
387 const std::string& user_id) { | 388 const std::string& user_id) { |
388 return user_id + kUserIdHashSuffix; | 389 return user_id + kUserIdHashSuffix; |
389 } | 390 } |
390 | 391 |
391 } // namespace chromeos | 392 } // namespace chromeos |
OLD | NEW |