Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
| index f318724d66073cefe0b16ef692270d23d425ceeb..c343448f22ada2f63d55eae7c3c7b91dfc7c9ee5 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -139,6 +139,18 @@ Profile* ProfileManager::GetProfile(const FilePath& profile_dir) { |
| return GetProfile(profile_dir, true); |
| } |
| +Profile* ProfileManager::GetProfileWithId(ProfileId profile_id) { |
|
willchan no longer on Chromium
2011/02/28 21:48:41
I think it should be a bug for profile_id == kInva
|
| + for (iterator i = begin(); i != end(); ++i) { |
| + if ((*i)->GetRuntimeId() == profile_id) |
| + return *i; |
| + if ((*i)->HasOffTheRecordProfile() && |
| + (*i)->GetOffTheRecordProfile()->GetRuntimeId() == profile_id) { |
| + return (*i)->GetOffTheRecordProfile(); |
| + } |
| + } |
| + return NULL; |
| +} |
| + |
| bool ProfileManager::IsValidProfile(Profile* profile) { |
| for (iterator i = begin(); i != end(); ++i) { |
| if (*i == profile) |