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

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: minor 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 201865)
+++ 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"
@@ -91,12 +92,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();
+ }
- 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