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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 6973035: Move download stuff to download tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops, forgot to add tab watcher as delegate with CF. 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
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index d51e63e9661413b0bb8fabf0d66afe22bca678c6..b4aee7c962069e04e147b0f2dde59dcc90f04a92 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -13,11 +13,9 @@
#include "base/string_util.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/debugger/devtools_manager.h"
#include "chrome/browser/defaults.h"
-#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/external_protocol_handler.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/load_from_memory_cache_details.h"
@@ -856,26 +854,6 @@ bool TabContents::ShouldShowBookmarkBar() {
false : render_manager_.web_ui()->force_bookmark_bar_visible();
}
-bool TabContents::CanDownload(int request_id) {
- TabContentsDelegate* d = delegate();
- if (d)
- return d->CanDownload(request_id);
- return true;
-}
-
-void TabContents::OnStartDownload(DownloadItem* download) {
- DCHECK(download);
-
- if (!delegate())
- return;
-
- // Download in a constrained popup is shown in the tab that opened it.
- TabContents* tab_contents = delegate()->GetConstrainingContents(this);
-
- if (tab_contents && tab_contents->delegate())
- tab_contents->delegate()->OnStartDownload(download, this);
-}
-
void TabContents::WillClose(ConstrainedWindow* window) {
ConstrainedWindowList::iterator i(
std::find(child_windows_.begin(), child_windows_.end(), window));
@@ -1954,11 +1932,8 @@ WebPreferences TabContents::GetWebkitPrefs() {
}
void TabContents::OnUserGesture() {
- // See comment in RenderViewHostDelegate::OnUserGesture as to why we do this.
- DownloadRequestLimiter* limiter =
- g_browser_process->download_request_limiter();
- if (limiter)
- limiter->OnUserGesture(this);
+ // Notify observers.
+ FOR_EACH_OBSERVER(TabContentsObserver, observers_, DidGetUserGesture());
ExternalProtocolHandler::PermitLaunchUrl();
}
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698