| 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 // Helper classes and functions used for the WebRequest API. | 5 // Helper classes and functions used for the WebRequest API. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 7 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| 8 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 8 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // if any, will have its authentication credentials used. |request| must be | 165 // if any, will have its authentication credentials used. |request| must be |
| 166 // non-NULL, and contain |deltas| that are sorted in decreasing order of | 166 // non-NULL, and contain |deltas| that are sorted in decreasing order of |
| 167 // precedence. | 167 // precedence. |
| 168 // Returns whether authentication credentials are set. | 168 // Returns whether authentication credentials are set. |
| 169 bool MergeOnAuthRequiredResponses( | 169 bool MergeOnAuthRequiredResponses( |
| 170 const EventResponseDeltas& deltas, | 170 const EventResponseDeltas& deltas, |
| 171 net::AuthCredentials* auth_credentials, | 171 net::AuthCredentials* auth_credentials, |
| 172 std::set<std::string>* conflicting_extensions, | 172 std::set<std::string>* conflicting_extensions, |
| 173 const net::BoundNetLog* net_log); | 173 const net::BoundNetLog* net_log); |
| 174 | 174 |
| 175 // Returns true if the request shall not be reported to extensions. | |
| 176 bool HideRequest(const net::URLRequest* request); | |
| 177 | |
| 178 // Returns whether |type| is a ResourceType that is handled by the web request | 175 // Returns whether |type| is a ResourceType that is handled by the web request |
| 179 // API. | 176 // API. |
| 180 bool IsRelevantResourceType(ResourceType::Type type); | 177 bool IsRelevantResourceType(ResourceType::Type type); |
| 181 | 178 |
| 182 // Returns a string representation of |type| or |other| if |type| is not handled | 179 // Returns a string representation of |type| or |other| if |type| is not handled |
| 183 // by the web request API. | 180 // by the web request API. |
| 184 const char* ResourceTypeToString(ResourceType::Type type); | 181 const char* ResourceTypeToString(ResourceType::Type type); |
| 185 | 182 |
| 186 // Stores a |ResourceType::Type| representation in |type| if |type_str| is | 183 // Stores a |ResourceType::Type| representation in |type| if |type_str| is |
| 187 // a resource type handled by the web request API. Returns true in case of | 184 // a resource type handled by the web request API. Returns true in case of |
| 188 // success. | 185 // success. |
| 189 bool ParseResourceType(const std::string& type_str, | 186 bool ParseResourceType(const std::string& type_str, |
| 190 ResourceType::Type* type); | 187 ResourceType::Type* type); |
| 191 | 188 |
| 192 // Returns whether |extension| may access |url| based on host permissions. | 189 // Returns whether |extension| may access |url| based on host permissions. |
| 193 // In addition to that access is granted to about: URLs and extension URLs | 190 // In addition to that access is granted to about: URLs and extension URLs |
| 194 // that are in the scope of |extension|. | 191 // that are in the scope of |extension|. |
| 195 bool CanExtensionAccessURL(const extensions::Extension* extension, | 192 bool CanExtensionAccessURL(const extensions::Extension* extension, |
| 196 const GURL& url); | 193 const GURL& url); |
| 197 | 194 |
| 198 } // namespace extension_web_request_api_helpers | 195 } // namespace extension_web_request_api_helpers |
| 199 | 196 |
| 200 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 197 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| OLD | NEW |