diff options
author | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 18:24:33 +0000 |
---|---|---|
committer | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 18:24:33 +0000 |
commit | 78d78a682025d5c60a6a4db42cff6d1c17436fa0 (patch) | |
tree | 925a344613c38be914f655dccba4e5c06e55bc73 /chrome/browser/ui | |
parent | 8fb41d1163c1797d806d7661d5314909570d07c9 (diff) | |
download | chromium_src-78d78a682025d5c60a6a4db42cff6d1c17436fa0.zip chromium_src-78d78a682025d5c60a6a4db42cff6d1c17436fa0.tar.gz chromium_src-78d78a682025d5c60a6a4db42cff6d1c17436fa0.tar.bz2 |
Change Browser::OpenApplication() to handle having no browser windows open.
Update Browser::OpenApplication() to create a new browser window if there are
no browser windows open for the profile.
Updated BackgroundModeManager and AppControllerMac to properly respect the
launch preference set by the user.
BUG=96075
TEST=Close browser window, open application via context menu, make sure there's just one tab.
Review URL: http://codereview.chromium.org/8059037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r-- | chrome/browser/ui/browser.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 00baca8..894cdc9 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -684,8 +684,13 @@ TabContents* Browser::OpenApplicationTab(Profile* profile, WindowOpenDisposition disposition) { Browser* browser = BrowserList::FindTabbedBrowser(profile, false); TabContents* contents = NULL; - if (!browser) - return contents; + if (!browser) { + // No browser for this profile, need to open a new one. + browser = Browser::Create(profile); + browser->window()->Show(); + // There's no current tab in this browser window, so add a new one. + disposition = NEW_FOREGROUND_TAB; + } // Check the prefs for overridden mode. ExtensionService* extension_service = profile->GetExtensionService(); |