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

Unified Diff: chrome/browser/net/chrome_network_delegate.h

Issue 2657903005: Factor out core logic from OnCanAccessFile() and add tests for it (Closed)
Patch Set: address comments Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.h
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index 759a0e5216843c879e9e3bb1099c8b2edf67471f..e3636c0798803679abf656f275b31f6c98f1b619 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -77,9 +77,9 @@ class ChromeNetworkDelegate : public net::NetworkDelegateImpl {
// Also pass through to ChromeExtensionsNetworkDelegate::set_profile().
void set_profile(void* profile);
- // |profile_path| is used to locate the "Downloads" folder on Chrome OS. If it
- // is set, the location of the Downloads folder for the profile is added to
- // the whitelist for accesses via file: scheme.
+ // |profile_path| is used to locate profile specific paths such as the
+ // "Downloads" folder on Chrome OS. If it is set, folders like Downloads
+ // for the profile are added to the whitelist for accesses via file: scheme.
void set_profile_path(const base::FilePath& profile_path) {
profile_path_ = profile_path;
}
@@ -129,6 +129,11 @@ class ChromeNetworkDelegate : public net::NetworkDelegateImpl {
StringPrefMember* allowed_domains_for_apps,
PrefService* pref_service);
+ // Returns true if access to |path| is allowed. |profile_path| is used to
+ // locate certain paths on Chrome OS. See set_profile_path() for details.
+ static bool IsAccessAllowed(const base::FilePath& path,
+ const base::FilePath& profile_path);
+
private:
// NetworkDelegate implementation.
int OnBeforeURLRequest(net::URLRequest* request,
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698