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

Unified Diff: chrome/browser/ui/browser.cc

Issue 1236003005: Move closing-blank-tab logic in Browser class to DownloadUIConttroller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 5 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/ui/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/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 242f79b29c7d3c32b105345e61d1168bff2ee2a9..61a36ff10a0df4b6e8b0c00ee54cee612f29012f 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -48,10 +48,8 @@
#include "chrome/browser/defaults.h"
#include "chrome/browser/devtools/devtools_toggle_action.h"
#include "chrome/browser/devtools/devtools_window.h"
-#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_service.h"
#include "chrome/browser/download/download_service_factory.h"
-#include "chrome/browser/download/download_shelf.h"
#include "chrome/browser/extensions/api/tabs/tabs_event_router.h"
#include "chrome/browser/extensions/api/tabs/tabs_windows_api.h"
#include "chrome/browser/extensions/browser_extension_window_controller.h"
@@ -169,8 +167,6 @@
#include "components/web_modal/popup_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/devtools_agent_host.h"
-#include "content/public/browser/download_item.h"
-#include "content/public/browser/download_manager.h"
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_controller.h"
@@ -1405,32 +1401,6 @@ void Browser::ShowFirstRunBubble() {
window()->GetLocationBar()->ShowFirstRunBubble();
}
-void Browser::ShowDownload(content::DownloadItem* download) {
- if (!window())
- return;
-
- // If the download occurs in a new tab, and it's not a save page
- // download (started before initial navigation completed) close it.
- // Avoid calling CloseContents if the tab is not in this browser's tab strip
- // model; this can happen if the download was initiated by something internal
- // to Chrome, such as by the app list.
- WebContents* source = download->GetWebContents();
- if (source && source->GetController().IsInitialNavigation() &&
- tab_strip_model_->count() > 1 &&
- tab_strip_model_->GetIndexOfWebContents(source) !=
- TabStripModel::kNoTab &&
- !download->IsSavePackageDownload()) {
- CloseContents(source);
- }
-
- // Some (app downloads) are not supposed to appear on the shelf.
- if (!DownloadItemModel(download).ShouldShowInShelf())
- return;
-
- // GetDownloadShelf creates the download shelf if it was not yet created.
- window()->GetDownloadShelf()->AddDownload(download);
-}
-
///////////////////////////////////////////////////////////////////////////////
// Browser, content::WebContentsDelegate implementation:
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698