OLD | NEW |
1 // Copyright 2015 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 IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ | 5 #ifndef IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ |
6 #define IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ | 6 #define IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Binds the pref members to |pref_service| and moves them to the IO thread. | 43 // Binds the pref members to |pref_service| and moves them to the IO thread. |
44 // This method should be called on the UI thread. | 44 // This method should be called on the UI thread. |
45 static void InitializePrefsOnUIThread(BooleanPrefMember* enable_do_not_track, | 45 static void InitializePrefsOnUIThread(BooleanPrefMember* enable_do_not_track, |
46 PrefService* pref_service); | 46 PrefService* pref_service); |
47 | 47 |
48 private: | 48 private: |
49 // NetworkDelegate implementation. | 49 // NetworkDelegate implementation. |
50 int OnBeforeURLRequest(net::URLRequest* request, | 50 int OnBeforeURLRequest(net::URLRequest* request, |
51 const net::CompletionCallback& callback, | 51 const net::CompletionCallback& callback, |
52 GURL* new_url) override; | 52 GURL* new_url) override; |
53 void OnCompleted(net::URLRequest* request, bool started) override; | 53 void OnCompleted(net::URLRequest* request, |
| 54 bool started, |
| 55 int net_error) override; |
54 net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( | 56 net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( |
55 net::URLRequest* request, | 57 net::URLRequest* request, |
56 const net::AuthChallengeInfo& auth_info, | 58 const net::AuthChallengeInfo& auth_info, |
57 const AuthCallback& callback, | 59 const AuthCallback& callback, |
58 net::AuthCredentials* credentials) override; | 60 net::AuthCredentials* credentials) override; |
59 bool OnCanGetCookies(const net::URLRequest& request, | 61 bool OnCanGetCookies(const net::URLRequest& request, |
60 const net::CookieList& cookie_list) override; | 62 const net::CookieList& cookie_list) override; |
61 bool OnCanSetCookie(const net::URLRequest& request, | 63 bool OnCanSetCookie(const net::URLRequest& request, |
62 const std::string& cookie_line, | 64 const std::string& cookie_line, |
63 net::CookieOptions* options) override; | 65 net::CookieOptions* options) override; |
64 bool OnCanAccessFile(const net::URLRequest& request, | 66 bool OnCanAccessFile(const net::URLRequest& request, |
65 const base::FilePath& path) const override; | 67 const base::FilePath& path) const override; |
66 bool OnCanEnablePrivacyMode( | 68 bool OnCanEnablePrivacyMode( |
67 const GURL& url, | 69 const GURL& url, |
68 const GURL& first_party_for_cookies) const override; | 70 const GURL& first_party_for_cookies) const override; |
69 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 71 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
70 const net::URLRequest& request, | 72 const net::URLRequest& request, |
71 const GURL& target_url, | 73 const GURL& target_url, |
72 const GURL& referrer_url) const override; | 74 const GURL& referrer_url) const override; |
73 | 75 |
74 scoped_refptr<content_settings::CookieSettings> cookie_settings_; | 76 scoped_refptr<content_settings::CookieSettings> cookie_settings_; |
75 | 77 |
76 // Weak, owned by our owner. | 78 // Weak, owned by our owner. |
77 BooleanPrefMember* enable_do_not_track_; | 79 BooleanPrefMember* enable_do_not_track_; |
78 | 80 |
79 DISALLOW_COPY_AND_ASSIGN(IOSChromeNetworkDelegate); | 81 DISALLOW_COPY_AND_ASSIGN(IOSChromeNetworkDelegate); |
80 }; | 82 }; |
81 | 83 |
82 #endif // IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ | 84 #endif // IOS_CHROME_BROWSER_NET_IOS_CHROME_NETWORK_DELEGATE_H_ |
OLD | NEW |