summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 05:49:47 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 05:49:47 +0000
commit1aa8f508f5a7a4355e4cf3eab80e67f5073a6f62 (patch)
treea8fdb19d526e552c65357a8cf9ef0da4482692d2 /chrome/browser/browser.cc
parent9fb44183c594f98189162a9b9dde704c5d32b771 (diff)
downloadchromium_src-1aa8f508f5a7a4355e4cf3eab80e67f5073a6f62.zip
chromium_src-1aa8f508f5a7a4355e4cf3eab80e67f5073a6f62.tar.gz
chromium_src-1aa8f508f5a7a4355e4cf3eab80e67f5073a6f62.tar.bz2
Browser Crash when opening urls with NEW_BACKGROUND_TAB disposition
When that disposition is used and no "normal" window is opened, it crashes. "normal" means non POPUP, non APPLICATION window type. This happens because background disposition doens't focus or activate the window unless selected. A crash happens because GetSelectedTabContents() is null since nothing initially there. This fix might have stopped it crash, but would be best to see if its a "good" approach. I fixed some lints such as, header file already exists, extra white space, etc) BUG=10591 ( http://crbug.com/10591 ) Original patch by Mohamed Mansour (see http://codereview.chromium.org/67205/show), r=me,pkasting Review URL: http://codereview.chromium.org/93058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index f0d4207..4b5234e 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1662,9 +1662,9 @@ void Browser::OpenURLFromTab(TabContents* source,
}
}
- // If this is 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_APP) {
+ // 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 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).