Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5812)

Unified Diff: chrome/browser/devtools/browser_list_tabcontents_provider.cc

Issue 15356002: http 'new' opens 2 tabs when there are no windows on cros. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698