Chromium Code Reviews| Index: chrome/browser/devtools/browser_list_tabcontents_provider.cc |
| =================================================================== |
| --- chrome/browser/devtools/browser_list_tabcontents_provider.cc (revision 200880) |
| +++ chrome/browser/devtools/browser_list_tabcontents_provider.cc (working copy) |
| @@ -19,6 +19,7 @@ |
| #include "chrome/browser/ui/browser_tabstrip.h" |
| #include "chrome/browser/ui/host_desktop.h" |
| #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| +#include "chrome/browser/ui/tabs/tab_strip_model.h" |
| #include "chrome/common/chrome_paths.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/common/url_constants.h" |
| @@ -33,7 +34,8 @@ |
| BrowserListTabContentsProvider::BrowserListTabContentsProvider( |
| Profile* profile, |
| chrome::HostDesktopType host_desktop_type) |
| - : profile_(profile), host_desktop_type_(host_desktop_type) { |
| + : profile_(profile->GetOriginalProfile()), |
|
Tim Song
2013/05/20 22:48:41
If the profile being passed in here is an incognit
achuithb
2013/05/20 23:10:00
Yup, that's here:
https://code.google.com/p/chromi
|
| + host_desktop_type_(host_desktop_type) { |
| } |
| BrowserListTabContentsProvider::~BrowserListTabContentsProvider() { |
| @@ -91,12 +93,13 @@ |
| const BrowserList* browser_list = |
| BrowserList::GetInstance(host_desktop_type_); |
| - if (browser_list->empty()) |
| + if (browser_list->empty()) { |
| chrome::NewEmptyWindow(profile_, host_desktop_type_); |
| + return browser_list->empty() ? NULL : |
| + browser_list->get(0)->tab_strip_model()->GetActiveWebContents()-> |
| + GetRenderViewHost(); |
|
Tim Song
2013/05/20 22:48:41
This is good, as we don't want two tabs being open
achuithb
2013/05/20 23:10:00
That code only kicks in when a tab is closed. This
|
| + } |
| - if (browser_list->empty()) |
| - return NULL; |
| - |
| content::WebContents* web_contents = chrome::AddSelectedTabWithURL( |
| browser_list->get(0), |
| GURL(content::kAboutBlankURL), |