| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void* profile, | 40 void* profile, |
| 41 CookieSettings* cookie_settings, | 41 CookieSettings* cookie_settings, |
| 42 BooleanPrefMember* enable_referrers); | 42 BooleanPrefMember* enable_referrers); |
| 43 virtual ~ChromeNetworkDelegate(); | 43 virtual ~ChromeNetworkDelegate(); |
| 44 | 44 |
| 45 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. | 45 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. |
| 46 // This method should be called on the UI thread. | 46 // This method should be called on the UI thread. |
| 47 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, | 47 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, |
| 48 PrefService* pref_service); | 48 PrefService* pref_service); |
| 49 | 49 |
| 50 // When called, all file:// URLs will now be accessible. If this is not |
| 51 // called, then some platforms restrict access to file:// paths. |
| 52 static void AllowAccessToAllFiles(); |
| 53 |
| 50 private: | 54 private: |
| 51 // NetworkDelegate implementation. | 55 // NetworkDelegate implementation. |
| 52 virtual int OnBeforeURLRequest(net::URLRequest* request, | 56 virtual int OnBeforeURLRequest(net::URLRequest* request, |
| 53 const net::CompletionCallback& callback, | 57 const net::CompletionCallback& callback, |
| 54 GURL* new_url) OVERRIDE; | 58 GURL* new_url) OVERRIDE; |
| 55 virtual int OnBeforeSendHeaders(net::URLRequest* request, | 59 virtual int OnBeforeSendHeaders(net::URLRequest* request, |
| 56 const net::CompletionCallback& callback, | 60 const net::CompletionCallback& callback, |
| 57 net::HttpRequestHeaders* headers) OVERRIDE; | 61 net::HttpRequestHeaders* headers) OVERRIDE; |
| 58 virtual void OnSendHeaders(net::URLRequest* request, | 62 virtual void OnSendHeaders(net::URLRequest* request, |
| 59 const net::HttpRequestHeaders& headers) OVERRIDE; | 63 const net::HttpRequestHeaders& headers) OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 70 int bytes_read) OVERRIDE; | 74 int bytes_read) OVERRIDE; |
| 71 virtual void OnCompleted(net::URLRequest* request, bool started) OVERRIDE; | 75 virtual void OnCompleted(net::URLRequest* request, bool started) OVERRIDE; |
| 72 virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; | 76 virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; |
| 73 virtual void OnPACScriptError(int line_number, | 77 virtual void OnPACScriptError(int line_number, |
| 74 const string16& error) OVERRIDE; | 78 const string16& error) OVERRIDE; |
| 75 virtual net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( | 79 virtual net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( |
| 76 net::URLRequest* request, | 80 net::URLRequest* request, |
| 77 const net::AuthChallengeInfo& auth_info, | 81 const net::AuthChallengeInfo& auth_info, |
| 78 const AuthCallback& callback, | 82 const AuthCallback& callback, |
| 79 net::AuthCredentials* credentials) OVERRIDE; | 83 net::AuthCredentials* credentials) OVERRIDE; |
| 80 virtual bool CanGetCookies(const net::URLRequest* request, | 84 virtual bool OnCanGetCookies(const net::URLRequest& request, |
| 81 const net::CookieList& cookie_list) OVERRIDE; | 85 const net::CookieList& cookie_list) OVERRIDE; |
| 82 virtual bool CanSetCookie(const net::URLRequest* request, | 86 virtual bool OnCanSetCookie(const net::URLRequest& request, |
| 83 const std::string& cookie_line, | 87 const std::string& cookie_line, |
| 84 net::CookieOptions* options) OVERRIDE; | 88 net::CookieOptions* options) OVERRIDE; |
| 89 virtual bool OnCanAccessFile(const net::URLRequest& request, |
| 90 const FilePath& path) const OVERRIDE; |
| 85 | 91 |
| 86 scoped_refptr<ExtensionEventRouterForwarder> event_router_; | 92 scoped_refptr<ExtensionEventRouterForwarder> event_router_; |
| 87 void* profile_; | 93 void* profile_; |
| 88 scoped_refptr<CookieSettings> cookie_settings_; | 94 scoped_refptr<CookieSettings> cookie_settings_; |
| 89 | 95 |
| 90 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 96 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 91 | 97 |
| 92 // Weak, owned by our owner. | 98 // Weak, owned by our owner. |
| 93 BooleanPrefMember* enable_referrers_; | 99 BooleanPrefMember* enable_referrers_; |
| 94 | 100 |
| 95 // Weak, owned by our owner. | 101 // Weak, owned by our owner. |
| 96 const policy::URLBlacklistManager* url_blacklist_manager_; | 102 const policy::URLBlacklistManager* url_blacklist_manager_; |
| 97 | 103 |
| 104 // When true, allow access to all file:// URLs. |
| 105 static bool g_allow_file_access_; |
| 106 |
| 98 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 107 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 99 }; | 108 }; |
| 100 | 109 |
| 101 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 110 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |