Index: chrome/browser/browser_list.cc |
=================================================================== |
--- chrome/browser/browser_list.cc (revision 14851) |
+++ chrome/browser/browser_list.cc (working copy) |
@@ -223,6 +223,23 @@ |
} |
// static |
+Browser* BrowserList::FindBrowserWithProfile(Profile* p) { |
+ Browser* last_active = GetLastActive(); |
+ if (last_active && last_active->profile() == p) |
+ return last_active; |
+ |
+ BrowserList::const_iterator i; |
+ for (i = BrowserList::begin(); i != BrowserList::end(); ++i) { |
+ if (*i == last_active) |
+ continue; |
+ |
+ if ((*i)->profile() == p) |
+ return *i; |
+ } |
+ return NULL; |
+} |
+ |
+// static |
Browser* BrowserList::FindBrowserWithID(SessionID::id_type desired_id) { |
BrowserList::const_iterator i; |
for (i = BrowserList::begin(); i != BrowserList::end(); ++i) { |