summaryrefslogtreecommitdiffstats
path: root/content/public/browser
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 01:11:25 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 01:11:25 +0000
commitea114727620483755ebecf7b3fe4e7f9d50316e4 (patch)
tree4731c05242dc6745d2a7e9fb50e1e310470c7138 /content/public/browser
parent0535866266fe81c93349f9abf0d2e2b87519b3d0 (diff)
downloadchromium_src-ea114727620483755ebecf7b3fe4e7f9d50316e4.zip
chromium_src-ea114727620483755ebecf7b3fe4e7f9d50316e4.tar.gz
chromium_src-ea114727620483755ebecf7b3fe4e7f9d50316e4.tar.bz2
Add content/public/browser/resource_dispatcher_host.h
R=jam@chromium.org TBR=willchan@chromium.org,mirandac@chromium.org,ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/9648020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/browser')
-rw-r--r--content/public/browser/resource_dispatcher_host.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/content/public/browser/resource_dispatcher_host.h b/content/public/browser/resource_dispatcher_host.h
new file mode 100644
index 0000000..efb6df5
--- /dev/null
+++ b/content/public/browser/resource_dispatcher_host.h
@@ -0,0 +1,69 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
+#define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
+#pragma once
+
+#include "base/callback_forward.h"
+#include "content/public/browser/download_id.h"
+#include "net/base/net_errors.h"
+
+struct DownloadSaveInfo;
+
+namespace net {
+class URLRequest;
+}
+
+namespace content {
+class ResourceContext;
+class ResourceDispatcherHostDelegate;
+
+class CONTENT_EXPORT ResourceDispatcherHost {
+ public:
+ typedef base::Callback<void(DownloadId, net::Error)> DownloadStartedCallback;
+
+ // Returns the singleton instance of the ResourceDispatcherHost.
+ static ResourceDispatcherHost* Get();
+
+ // This does not take ownership of the delegate. It is expected that the
+ // delegate have a longer lifetime than the ResourceDispatcherHost.
+ virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) = 0;
+
+ // Controls whether third-party sub-content can pop-up HTTP basic auth
+ // dialog boxes.
+ virtual void SetAllowCrossOriginAuthPrompt(bool value) = 0;
+
+ // Force cancels any pending requests for the given |context|. This is
+ // necessary to ensure that before |context| goes away, all requests
+ // for it are dead.
+ virtual void CancelRequestsForContext(ResourceContext* context) = 0;
+
+ // Initiates a download by explicit request of the renderer, e.g. due to
+ // alt-clicking a link. If the download is started, |started_callback| will
+ // be called on the UI thread with the DownloadId; otherwise an error code
+ // will be returned.
+ virtual net::Error BeginDownload(
+ scoped_ptr<net::URLRequest> request,
+ ResourceContext* context,
+ int child_id,
+ int route_id,
+ bool prefer_cache,
+ const DownloadSaveInfo& save_info,
+ const DownloadStartedCallback& started_callback) = 0;
+
+ // Clears the ResourceDispatcherHostLoginDelegate associated with the request.
+ virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0;
+
+ // Marks the request as "parked". This happens if a request is
+ // redirected cross-site and needs to be resumed by a new render view.
+ virtual void MarkAsTransferredNavigation(net::URLRequest* request) = 0;
+
+ protected:
+ virtual ~ResourceDispatcherHost() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_