OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_NETWORK_DELEGATE_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "net/base/network_delegate_impl.h" | 10 #include "net/base/network_delegate_impl.h" |
11 | 11 |
12 namespace content { | 12 namespace headless { |
13 | 13 |
14 class ShellNetworkDelegate : public net::NetworkDelegateImpl { | 14 class HeadlessNetworkDelegate : public net::NetworkDelegateImpl { |
15 public: | 15 public: |
16 ShellNetworkDelegate(); | 16 HeadlessNetworkDelegate(); |
17 ~ShellNetworkDelegate() override; | 17 ~HeadlessNetworkDelegate() override; |
18 | 18 |
19 static void SetAcceptAllCookies(bool accept); | 19 static void SetAcceptAllCookies(bool accept); |
20 | 20 |
21 private: | 21 private: |
22 // net::NetworkDelegate implementation. | 22 // net::NetworkDelegate implementation. |
23 int OnBeforeURLRequest(net::URLRequest* request, | 23 int OnBeforeURLRequest(net::URLRequest* request, |
24 const net::CompletionCallback& callback, | 24 const net::CompletionCallback& callback, |
25 GURL* new_url) override; | 25 GURL* new_url) override; |
26 int OnBeforeSendHeaders(net::URLRequest* request, | 26 int OnBeforeSendHeaders(net::URLRequest* request, |
27 const net::CompletionCallback& callback, | 27 const net::CompletionCallback& callback, |
(...skipping 19 matching lines...) Expand all Loading... |
47 net::AuthCredentials* credentials) override; | 47 net::AuthCredentials* credentials) override; |
48 bool OnCanGetCookies(const net::URLRequest& request, | 48 bool OnCanGetCookies(const net::URLRequest& request, |
49 const net::CookieList& cookie_list) override; | 49 const net::CookieList& cookie_list) override; |
50 bool OnCanSetCookie(const net::URLRequest& request, | 50 bool OnCanSetCookie(const net::URLRequest& request, |
51 const std::string& cookie_line, | 51 const std::string& cookie_line, |
52 net::CookieOptions* options) override; | 52 net::CookieOptions* options) override; |
53 bool OnCanAccessFile(const net::URLRequest& request, | 53 bool OnCanAccessFile(const net::URLRequest& request, |
54 const base::FilePath& path) const override; | 54 const base::FilePath& path) const override; |
55 bool OnAreExperimentalCookieFeaturesEnabled() const override; | 55 bool OnAreExperimentalCookieFeaturesEnabled() const override; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(ShellNetworkDelegate); | 57 DISALLOW_COPY_AND_ASSIGN(HeadlessNetworkDelegate); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace content | 60 } // namespace headless |
61 | 61 |
62 #endif // CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_ | 62 #endif // HEADLESS_LIB_BROWSER_HEADLESS_NETWORK_DELEGATE_H_ |
OLD | NEW |