summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 22:30:35 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 22:30:35 +0000
commitfba16f51d79a27b275cd858d9e888c1ace518972 (patch)
tree80c29e105c45af8a186a805c9d03ef97a648811c /chrome/browser
parent2e417c8257e0007ef3fb6929a507268d0450bd4a (diff)
downloadchromium_src-fba16f51d79a27b275cd858d9e888c1ace518972.zip
chromium_src-fba16f51d79a27b275cd858d9e888c1ace518972.tar.gz
chromium_src-fba16f51d79a27b275cd858d9e888c1ace518972.tar.bz2
Only create one downloads tab per window. If there is already a Downloads
tab, then switch to it instead of creating new one. Introduce FOCUS_SINGLETON_TAB disposition. patch by Mohamed Mansour <http://codereview.chromium.org/50003/show> Review URL: http://codereview.chromium.org/60062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser.cc5
-rw-r--r--chrome/browser/download/download_shelf.cc2
-rw-r--r--chrome/browser/external_tab_container.cc1
3 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index d2c3c50..f4f6d94 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1634,7 +1634,10 @@ void Browser::OpenURLFromTab(TabContents* source,
if (profile_->IsOffTheRecord() && disposition == OFF_THE_RECORD)
disposition = NEW_FOREGROUND_TAB;
- if (disposition == NEW_WINDOW) {
+ if (disposition == SINGLETON_TAB) {
+ ShowSingleDOMUITab(url);
+ return;
+ } else if (disposition == NEW_WINDOW) {
Browser* browser = Browser::Create(profile_);
new_contents = browser->AddTabWithURL(url, referrer, transition, true,
instance);
diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc
index f27b46d..7563d71 100644
--- a/chrome/browser/download/download_shelf.cc
+++ b/chrome/browser/download/download_shelf.cc
@@ -27,7 +27,7 @@ void DownloadShelf::ShowAllDownloads() {
if (profile)
UserMetrics::RecordAction(L"ShowDownloads", profile);
tab_contents_->OpenURL(GURL(chrome::kChromeUIDownloadsURL), GURL(),
- NEW_FOREGROUND_TAB, PageTransition::AUTO_BOOKMARK);
+ SINGLETON_TAB, PageTransition::AUTO_BOOKMARK);
}
void DownloadShelf::ChangeTabContents(TabContents* old_contents,
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc
index 538ed445..9ac5706 100644
--- a/chrome/browser/external_tab_container.cc
+++ b/chrome/browser/external_tab_container.cc
@@ -191,6 +191,7 @@ void ExternalTabContainer::OpenURLFromTab(TabContents* source,
PageTransition::Type transition) {
switch (disposition) {
case CURRENT_TAB:
+ case SINGLETON_TAB:
case NEW_FOREGROUND_TAB:
case NEW_BACKGROUND_TAB:
case NEW_WINDOW: