summaryrefslogtreecommitdiffstats
path: root/content/public/browser/resource_dispatcher_host.h
blob: 49366749251c54b5cd11e182ea8fd048c8764548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// 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_

#include <stdint.h>

#include "base/callback_forward.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"

namespace net {
class URLRequest;
}

namespace content {

class DownloadItem;
class ResourceContext;
class ResourceDispatcherHostDelegate;
struct DownloadSaveInfo;
struct Referrer;
class RenderFrameHost;

class CONTENT_EXPORT ResourceDispatcherHost {
 public:
  // Returns the singleton instance of the ResourceDispatcherHost.
  static ResourceDispatcherHost* Get();

  // Causes all new requests for the root RenderFrameHost and its children to be
  // blocked (not being started) until ResumeBlockedRequestsForFrameFromUI is
  // called.
  static void BlockRequestsForFrameFromUI(RenderFrameHost* root_frame_host);

  // Resumes any blocked request for the specified root RenderFrameHost and
  // child frame hosts.
  static void ResumeBlockedRequestsForFrameFromUI(
      RenderFrameHost* root_frame_host);

  // 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;

  // Clears the ResourceDispatcherHostLoginDelegate associated with the request.
  virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0;

 protected:
  virtual ~ResourceDispatcherHost() {}
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_