Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: chrome/browser/browser.cc

Issue 39002: Make it so that history and downloads are opened once per window unless the u... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 10778)
+++ chrome/browser/browser.cc (working copy)
@@ -536,22 +536,18 @@
restored_controller);
}
-void Browser::ShowNativeUITab(const GURL& url) {
+void Browser::ShowSingleDOMUITab(const GURL& url) {
int i, c;
TabContents* tc;
for (i = 0, c = tabstrip_model_.count(); i < c; ++i) {
tc = tabstrip_model_.GetTabContentsAt(i);
- if (tc->type() == TAB_CONTENTS_NATIVE_UI &&
+ if (tc->type() == TAB_CONTENTS_DOM_UI &&
tc->GetURL() == url) {
tabstrip_model_.SelectTabContentsAt(i, false);
return;
}
}
-
- TabContents* contents = CreateTabContentsForURL(url, GURL(), profile_,
- PageTransition::LINK, false,
- NULL);
- AddNewContents(NULL, contents, NEW_FOREGROUND_TAB, gfx::Rect(), true);
+ AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, NULL);
}
///////////////////////////////////////////////////////////////////////////////
@@ -971,9 +967,7 @@
void Browser::ShowHistoryTab() {
UserMetrics::RecordAction(L"ShowHistory", profile_);
- GURL downloads_url = HistoryUI::GetBaseURL();
- AddTabWithURL(downloads_url, GURL(), PageTransition::AUTO_BOOKMARK, true,
- NULL);
+ ShowSingleDOMUITab(HistoryUI::GetBaseURL());
}
void Browser::OpenBookmarkManager() {
@@ -983,9 +977,7 @@
void Browser::ShowDownloadsTab() {
UserMetrics::RecordAction(L"ShowDownloads", profile_);
- GURL downloads_url = DownloadsUI::GetBaseURL();
- AddTabWithURL(downloads_url, GURL(), PageTransition::AUTO_BOOKMARK, true,
- NULL);
+ ShowSingleDOMUITab(DownloadsUI::GetBaseURL());
}
void Browser::OpenClearBrowsingDataDialog() {
« no previous file with comments | « chrome/browser/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698