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

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

Issue 7035015: Revert 85504 - Move download stuff to download tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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
Index: chrome/browser/ui/download/download_tab_helper.cc
===================================================================
--- chrome/browser/ui/download/download_tab_helper.cc (revision 85514)
+++ chrome/browser/ui/download/download_tab_helper.cc (working copy)
@@ -4,14 +4,9 @@
#include "chrome/browser/ui/download/download_tab_helper.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_manager.h"
-#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
-#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h"
-#include "chrome/browser/ui/download/download_tab_helper_delegate.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/render_messages.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -19,8 +14,7 @@
DownloadTabHelper::DownloadTabHelper(TabContentsWrapper* tab_contents)
: TabContentsObserver(tab_contents->tab_contents()),
- tab_contents_wrapper_(tab_contents),
- delegate_(NULL) {
+ tab_contents_wrapper_(tab_contents) {
DCHECK(tab_contents);
}
@@ -68,31 +62,6 @@
return save_package_->Init();
}
-bool DownloadTabHelper::CanDownload(int request_id) {
- if (delegate_)
- return delegate_->CanDownload(request_id);
- return true;
-}
-
-void DownloadTabHelper::OnStartDownload(DownloadItem* download) {
- DCHECK(download);
-
- BlockedContentTabHelperDelegate* blocked_content_delegate =
- tab_contents_wrapper_->blocked_content_tab_helper()->delegate();
- if (!blocked_content_delegate)
- return;
-
- // Download in a constrained popup is shown in the tab that opened it.
- TabContentsWrapper* tab_contents =
- blocked_content_delegate->GetConstrainingContentsWrapper(
- tab_contents_wrapper_);
-
- if (tab_contents && tab_contents->download_tab_helper()->delegate()) {
- tab_contents->download_tab_helper()->delegate()->OnStartDownload(
- download, tab_contents_wrapper_);
- }
-}
-
bool DownloadTabHelper::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(DownloadTabHelper, message)
@@ -103,9 +72,3 @@
return handled;
}
-void DownloadTabHelper::DidGetUserGesture() {
- DownloadRequestLimiter* limiter =
- g_browser_process->download_request_limiter();
- if (limiter)
- limiter->OnUserGesture(tab_contents());
-}
« no previous file with comments | « chrome/browser/ui/download/download_tab_helper.h ('k') | chrome/browser/ui/download/download_tab_helper_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698