summaryrefslogtreecommitdiffstats
path: root/chrome/browser/external_tab_container.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-07 02:35:04 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-07 02:35:04 +0000
commitfc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3 (patch)
treeca9186ed7ddbeb19604b495430d9c9814df57471 /chrome/browser/external_tab_container.cc
parentcfc076ec466fc48e91c309448c4e5be3467b42c7 (diff)
downloadchromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.zip
chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.tar.gz
chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.tar.bz2
Basic wiring to enable downloads for CF's host browser network stack. A notable change here is that url automation job id's no longer exist and instead a request id is used. There's a 1 to 1 relation between a job and a request so this is more convenient.
Review URL: http://codereview.chromium.org/355036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.cc')
-rw-r--r--chrome/browser/external_tab_container.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc
index 4da768f..d200891 100644
--- a/chrome/browser/external_tab_container.cc
+++ b/chrome/browser/external_tab_container.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/page_info_window.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
+#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "chrome/browser/tab_contents/provisional_load_details.h"
#include "chrome/browser/views/tab_contents/render_view_context_menu_external_win.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -394,12 +395,28 @@ bool ExternalTabContainer::TakeFocus(bool reverse) {
return true;
}
+bool ExternalTabContainer::CanDownload(int request_id) {
+ if (load_requests_via_automation_) {
+ if (automation_) {
+ // NOTE: The request_id must be the same id as used by corresponding
+ // URLRequestAutomationJob instance to communicate with the host.
+ automation_->Send(new AutomationMsg_DownloadRequestInHost(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,
bool show_history) {
- browser::ShowPageInfo(GetNativeView(), profile, url, ssl,
- show_history);
+ browser::ShowPageInfo(GetNativeView(), profile, url, ssl, show_history);
}
bool ExternalTabContainer::HandleContextMenu(const ContextMenuParams& params) {