OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_RENDERER_HOST_DUMMY_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_DUMMY_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/compiler_specific.h" |
| 11 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
| 12 |
| 13 // Dummy implementation of ResourceDispatcherHostDelegate for test use. |
| 14 // All invocation will be redirected to underlying delegate. |
| 15 class DummyResourceDispatcherHostDelegate |
| 16 : public content::ResourceDispatcherHostDelegate { |
| 17 public: |
| 18 virtual bool ShouldBeginRequest( |
| 19 int child_id, |
| 20 int route_id, |
| 21 const std::string& method, |
| 22 const GURL& url, |
| 23 ResourceType::Type resource_type, |
| 24 const content::ResourceContext& resource_context, |
| 25 const content::Referrer& referrer) OVERRIDE; |
| 26 |
| 27 virtual ResourceHandler* RequestBeginning( |
| 28 ResourceHandler* handler, |
| 29 net::URLRequest* request, |
| 30 const content::ResourceContext& resource_context, |
| 31 bool is_subresource, |
| 32 int child_id, |
| 33 int route_id, |
| 34 bool is_continuation_of_transferred_request) OVERRIDE; |
| 35 |
| 36 virtual ResourceHandler* DownloadStarting( |
| 37 ResourceHandler* handler, |
| 38 const content::ResourceContext& resource_context, |
| 39 net::URLRequest* request, |
| 40 int child_id, |
| 41 int route_id, |
| 42 int request_id, |
| 43 bool is_new_request) OVERRIDE; |
| 44 |
| 45 virtual bool ShouldDeferStart( |
| 46 net::URLRequest* request, |
| 47 const content::ResourceContext& resource_context) OVERRIDE; |
| 48 |
| 49 virtual bool AcceptSSLClientCertificateRequest( |
| 50 net::URLRequest* request, |
| 51 net::SSLCertRequestInfo* cert_request_info) OVERRIDE; |
| 52 |
| 53 virtual bool AcceptAuthRequest(net::URLRequest* request, |
| 54 net::AuthChallengeInfo* auth_info) OVERRIDE; |
| 55 |
| 56 virtual content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( |
| 57 net::AuthChallengeInfo* auth_info, net::URLRequest* request) OVERRIDE; |
| 58 |
| 59 virtual void HandleExternalProtocol(const GURL& url, |
| 60 int child_id, |
| 61 int route_id) OVERRIDE; |
| 62 |
| 63 virtual bool ShouldForceDownloadResource( |
| 64 const GURL& url, const std::string& mime_type) OVERRIDE; |
| 65 |
| 66 virtual void OnResponseStarted( |
| 67 net::URLRequest* request, |
| 68 content::ResourceResponse* response, |
| 69 ResourceMessageFilter* filter) OVERRIDE; |
| 70 |
| 71 virtual void OnRequestRedirected( |
| 72 net::URLRequest* request, |
| 73 content::ResourceResponse* response, |
| 74 ResourceMessageFilter* filter) OVERRIDE; |
| 75 |
| 76 protected: |
| 77 explicit DummyResourceDispatcherHostDelegate( |
| 78 content::ResourceDispatcherHostDelegate* underlying); |
| 79 virtual ~DummyResourceDispatcherHostDelegate(); |
| 80 content::ResourceDispatcherHostDelegate* underlying(); |
| 81 |
| 82 private: |
| 83 content::ResourceDispatcherHostDelegate* underlying_; |
| 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(DummyResourceDispatcherHostDelegate); |
| 86 }; |
| 87 |
| 88 #endif // CHROME_BROWSER_RENDERER_HOST_DUMMY_RESOURCE_DISPATCHER_HOST_DELEGATE_
H_ |
OLD | NEW |