Index: chrome/browser/browser.cc |
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc |
index 0561187fc62fe0cb5f7a99d3929d0fdd744e6596..2de6237e833e74ebaa8ea526e85f0d6f30aa44f2 100644 |
--- a/chrome/browser/browser.cc |
+++ b/chrome/browser/browser.cc |
@@ -2092,6 +2092,22 @@ void Browser::ExecuteCommand(int id) { |
// Browser, TabStripModelDelegate implementation: |
TabContents* Browser::AddBlankTab(bool foreground) { |
+ // To make a more "launchy" experience, try to reuse an existing NTP if there |
+ // is one. |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableExtensionApps)) { |
+ for (int i = tabstrip_model_.count() - 1; i >= 0; --i) { |
+ TabContents* contents = tabstrip_model_.GetTabContentsAt(i); |
+ if (StartsWithASCII(contents->GetURL().spec(), |
+ chrome::kChromeUINewTabURL, true)) { |
+ if (foreground) |
+ SelectTabContentsAt(i, true); |
+ |
+ return contents; |
+ } |
+ } |
+ } |
+ |
return AddBlankTabAt(-1, foreground); |
} |