Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / shell / browser / shell_network_delegate.h
blob49b8f2372d62718bcb5d7822f808b5910e2a3f73
1 // Copyright 2013 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.
5 #ifndef CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "net/base/network_delegate_impl.h"
12 namespace content {
14 class ShellNetworkDelegate : public net::NetworkDelegateImpl {
15 public:
16 ShellNetworkDelegate();
17 ~ShellNetworkDelegate() override;
19 static void SetAcceptAllCookies(bool accept);
21 private:
22 // net::NetworkDelegate implementation.
23 int OnBeforeURLRequest(net::URLRequest* request,
24 const net::CompletionCallback& callback,
25 GURL* new_url) override;
26 int OnBeforeSendHeaders(net::URLRequest* request,
27 const net::CompletionCallback& callback,
28 net::HttpRequestHeaders* headers) override;
29 void OnSendHeaders(net::URLRequest* request,
30 const net::HttpRequestHeaders& headers) override;
31 int OnHeadersReceived(
32 net::URLRequest* request,
33 const net::CompletionCallback& callback,
34 const net::HttpResponseHeaders* original_response_headers,
35 scoped_refptr<net::HttpResponseHeaders>* override_response_headers,
36 GURL* allowed_unsafe_redirect_url) override;
37 void OnBeforeRedirect(net::URLRequest* request,
38 const GURL& new_location) override;
39 void OnResponseStarted(net::URLRequest* request) override;
40 void OnCompleted(net::URLRequest* request, bool started) override;
41 void OnURLRequestDestroyed(net::URLRequest* request) override;
42 void OnPACScriptError(int line_number, const base::string16& error) override;
43 AuthRequiredResponse OnAuthRequired(
44 net::URLRequest* request,
45 const net::AuthChallengeInfo& auth_info,
46 const AuthCallback& callback,
47 net::AuthCredentials* credentials) override;
48 bool OnCanGetCookies(const net::URLRequest& request,
49 const net::CookieList& cookie_list) override;
50 bool OnCanSetCookie(const net::URLRequest& request,
51 const std::string& cookie_line,
52 net::CookieOptions* options) override;
53 bool OnCanAccessFile(const net::URLRequest& request,
54 const base::FilePath& path) const override;
55 bool OnFirstPartyOnlyCookieExperimentEnabled() const override;
57 DISALLOW_COPY_AND_ASSIGN(ShellNetworkDelegate);
60 } // namespace content
62 #endif // CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_