Chromium Code Reviews| Index: chrome/browser/ui/browser_list.cc |
| diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc |
| index 1d3f06c372558e3ab7ed4036b229c5ba4f25a914..4cc0b528376dc218b7830defc91112e31c40aefa 100644 |
| --- a/chrome/browser/ui/browser_list.cc |
| +++ b/chrome/browser/ui/browser_list.cc |
| @@ -684,6 +684,16 @@ Browser* BrowserList::FindBrowserWithWindow(gfx::NativeWindow window) { |
| } |
| // static |
| +Browser* BrowserList::FindBrowserWithTabContents(TabContents* tab_contents) { |
|
James Hawkins
2011/10/12 17:34:18
DCHECK(tab_contents).
sail
2011/10/12 17:54:12
Done.
|
| + for (TabContentsIterator it; !it.done(); ++it) { |
| + TabContents* tab = it->tab_contents(); |
|
James Hawkins
2011/10/12 17:34:18
if (it->tab_contents() == tab_contents)
return i
sail
2011/10/12 17:54:12
Done.
sail
2011/10/12 17:54:12
Done.
|
| + if (tab == tab_contents) |
| + return it.browser(); |
| + } |
| + return NULL; |
| +} |
| + |
| +// static |
| size_t BrowserList::GetBrowserCountForType(Profile* profile, |
| bool match_tabbed) { |
| size_t result = 0; |