Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Side by Side Diff: chrome/browser/net/chrome_network_delegate.h

Issue 10068021: Fix file access on Chrome for ChromeOS on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload after sync Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 CanGetCookiesInternal(
81 const net::CookieList& cookie_list) OVERRIDE; 85 const net::URLRequest& request,
82 virtual bool CanSetCookie(const net::URLRequest* request, 86 const net::CookieList& cookie_list) OVERRIDE;
83 const std::string& cookie_line, 87 virtual bool CanSetCookieInternal(const net::URLRequest& request,
84 net::CookieOptions* options) OVERRIDE; 88 const std::string& cookie_line,
89 net::CookieOptions* options) OVERRIDE;
90 virtual bool CanAccessFileInternal(const net::URLRequest& request,
91 const FilePath& path) const OVERRIDE;
85 92
86 scoped_refptr<ExtensionEventRouterForwarder> event_router_; 93 scoped_refptr<ExtensionEventRouterForwarder> event_router_;
87 void* profile_; 94 void* profile_;
88 scoped_refptr<CookieSettings> cookie_settings_; 95 scoped_refptr<CookieSettings> cookie_settings_;
89 96
90 scoped_refptr<ExtensionInfoMap> extension_info_map_; 97 scoped_refptr<ExtensionInfoMap> extension_info_map_;
91 98
92 // Weak, owned by our owner. 99 // Weak, owned by our owner.
93 BooleanPrefMember* enable_referrers_; 100 BooleanPrefMember* enable_referrers_;
94 101
95 // Weak, owned by our owner. 102 // Weak, owned by our owner.
96 const policy::URLBlacklistManager* url_blacklist_manager_; 103 const policy::URLBlacklistManager* url_blacklist_manager_;
97 104
105 // When true, allow access to all file:// URLs.
106 static bool g_allow_file_access_;
107
98 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 108 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
99 }; 109 };
100 110
101 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 111 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698