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

Unified Diff: chrome/browser/external_tab_container_win.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 | « chrome/browser/external_tab_container_win.h ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/external_tab_container_win.cc
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index b3787d79acee200509ff766ee1e76afc1b4a03e8..1ba4ee133bb89dd27e38e48a9651d00b29ea3525 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -159,6 +159,7 @@ bool ExternalTabContainer::Init(Profile* profile,
}
tab_contents_->tab_contents()->set_delegate(this);
+ tab_contents_->download_tab_helper()->set_delegate(this);
tab_contents_->tab_contents()->
GetMutableRendererPrefs()->browser_handles_top_level_requests =
@@ -539,26 +540,6 @@ bool ExternalTabContainer::TakeFocus(bool reverse) {
return true;
}
-bool ExternalTabContainer::CanDownload(int request_id) {
- if (load_requests_via_automation_) {
- if (automation_) {
- // In case the host needs to show UI that needs to take the focus.
- ::AllowSetForegroundWindow(ASFW_ANY);
-
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(automation_resource_message_filter_.get(),
- &AutomationResourceMessageFilter::SendDownloadRequestToHost,
- 0, tab_handle_, request_id));
- }
- } else {
- DLOG(WARNING) << "Downloads are only supported with host browser network "
- "stack enabled.";
- }
-
- // Never allow downloads.
- return false;
-}
-
void ExternalTabContainer::ShowPageInfo(Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
@@ -784,6 +765,34 @@ void ExternalTabContainer::Observe(NotificationType type,
}
////////////////////////////////////////////////////////////////////////////////
+// ExternalTabContainer, DownloadTabHelperDelegate overrides:
+
+bool ExternalTabContainer::CanDownload(int request_id) {
+ if (load_requests_via_automation_) {
+ if (automation_) {
+ // In case the host needs to show UI that needs to take the focus.
+ ::AllowSetForegroundWindow(ASFW_ANY);
+
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(automation_resource_message_filter_.get(),
+ &AutomationResourceMessageFilter::SendDownloadRequestToHost,
+ 0, tab_handle_, request_id));
+ }
+ } else {
+ DLOG(WARNING) << "Downloads are only supported with host browser network "
+ "stack enabled.";
+ }
+
+ // Never allow downloads.
+ return false;
+}
+
+void ExternalTabContainer::OnStartDownload(DownloadItem* download,
+ TabContentsWrapper* tab) {
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
// ExternalTabContainer, views::WidgetWin overrides:
LRESULT ExternalTabContainer::OnCreate(LPCREATESTRUCT create_struct) {
« no previous file with comments | « chrome/browser/external_tab_container_win.h ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698