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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_delegate.h

Issue 7058041: Remove ResourceDispatcherHost dependency on Chrome's LoginHandler and ExternalProtocolHandler. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix deps 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: content/browser/renderer_host/resource_dispatcher_host_delegate.h
===================================================================
--- content/browser/renderer_host/resource_dispatcher_host_delegate.h (revision 0)
+++ content/browser/renderer_host/resource_dispatcher_host_delegate.h (revision 0)
@@ -0,0 +1,91 @@
+// Copyright (c) 2011 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_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+#define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+
+class GURL;
+class ResourceDispatcherHostLoginDelegate;
+class ResourceHandler;
+struct ResourceHostMsg_Request;
+
+namespace content {
+class ResourceContext;
+}
+
+namespace net {
+class AuthChallengeInfo;
+class SSLCertRequestInfo;
+class URLRequest;
+}
+
+// Interface that the embedder provides to ResourceDispatcherHost to allow
+// observing and modifying requests.
+class ResourceDispatcherHostDelegate {
+ public:
+ // Called when a request begins. Return false to abort the request.
+ virtual bool ShouldBeginRequest(
+ int child_id, int route_id,
+ const ResourceHostMsg_Request& request_data,
+ const content::ResourceContext& resource_context,
+ const GURL& referrer);
+
+ // Called after ShouldBeginRequest when all the resource handlers from the
+ // content layer have been added. To add new handlers to the front, return
+ // a new handler that is chained to the given one, otherwise just reutrn the
+ // given handler.
+ virtual ResourceHandler* RequestBeginning(ResourceHandler* handler,
+ net::URLRequest* request,
+ bool is_subresource,
+ int child_id,
+ int route_id);
+
+ // Called when a download is starting, after the resource handles from the
+ // content layer have been added.
+ virtual ResourceHandler* DownloadStarting(ResourceHandler* handler,
+ int child_id,
+ int route_id);
+
+ // Called to determine whether a request's start should be deferred. This
+ // is only called if the ResourceHandler associated with the request does
+ // not ask for a deferral. A return value of true will defer the start of
+ // the request, false will continue the request.
+ virtual bool ShouldDeferStart(
+ net::URLRequest* request,
+ const content::ResourceContext& resource_context);
+
+ // Called when an SSL Client Certificate is requested. If false is returned,
+ // the request is canceled. Otherwise, the certificate is chosen.
+ virtual bool AcceptSSLClientCertificateRequest(
+ net::URLRequest* request,
+ net::SSLCertRequestInfo* cert_request_info);
+
+ // Called when authentication is required and credentials are needed. If
+ // false is returned, CancelAuth() is called on the URLRequest and the error
+ // page is shown. If true is returned, the user will be prompted for
+ // authentication credentials.
+ virtual bool AcceptAuthRequest(net::URLRequest* request,
+ net::AuthChallengeInfo* auth_info);
+
+ // Creates a ResourceDispatcherHostLoginDelegate that asks the user for a
+ // username and password.
+ virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
+ net::AuthChallengeInfo* auth_info, net::URLRequest* request);
+
+ // Launches the url for the given tab.
+ virtual void HandleExternalProtocol(const GURL& url,
+ int child_id,
+ int route_id);
+
+ protected:
+ ResourceDispatcherHostDelegate();
+ virtual ~ResourceDispatcherHostDelegate();
+};
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
Property changes on: content\browser\renderer_host\resource_dispatcher_host_delegate.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698