summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-19 01:12:15 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-19 01:12:15 +0000
commit5cac73c53a1ad00980b63568181dc9506ec3c538 (patch)
tree05bf3e16358cfbcbd21d841e079379225bdd4c83 /chrome/browser
parent0d37bd3b66ad2c9a782e0fefb26addddf39a84cf (diff)
downloadchromium_src-5cac73c53a1ad00980b63568181dc9506ec3c538.zip
chromium_src-5cac73c53a1ad00980b63568181dc9506ec3c538.tar.gz
chromium_src-5cac73c53a1ad00980b63568181dc9506ec3c538.tar.bz2
Allow app/popup Windows to be programmatically sent a CURRENT_TAB navigation instead of having it change to a tabbed browser. Original patch by David Garcia (see http://codereview.chromium.org/505013 ), r=me, tweaked.
BUG=20529 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35017 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 575d144..6003651 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1995,9 +1995,8 @@ void Browser::AddNewContents(TabContents* source,
// If this is an application we can only have one tab so we need to process
// this in tabbed browser window.
- if (tabstrip_model_.count() > 0 &&
- disposition != NEW_WINDOW && disposition != NEW_POPUP &&
- type_ != TYPE_NORMAL) {
+ if (type_ != TYPE_NORMAL && tabstrip_model_.count() > 0 &&
+ disposition != NEW_WINDOW && disposition != NEW_POPUP) {
Browser* b = GetOrCreateTabbedBrowser(profile_);
DCHECK(b);
PageTransition::Type transition = PageTransition::LINK;
@@ -2944,8 +2943,7 @@ bool Browser::CanCloseWithInProgressDownloads() {
// static
Browser* Browser::GetOrCreateTabbedBrowser(Profile* profile) {
- Browser* browser = BrowserList::FindBrowserWithType(
- profile, TYPE_NORMAL);
+ Browser* browser = BrowserList::FindBrowserWithType(profile, TYPE_NORMAL);
if (!browser)
browser = Browser::Create(profile);
return browser;
@@ -2986,7 +2984,8 @@ void Browser::OpenURLAtIndex(TabContents* source,
// If this is not a normal window (such as a popup or an application), we can
// only have one tab so a new tab always goes into a tabbed browser window.
- if (disposition != NEW_WINDOW && type_ != TYPE_NORMAL) {
+ if (type_ != TYPE_NORMAL &&
+ disposition != CURRENT_TAB && disposition != NEW_WINDOW) {
// If the disposition is OFF_THE_RECORD we don't want to create a new
// browser that will itself create another OTR browser. This will result in
// a browser leak (and crash below because no tab is created or selected).