| 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/time.h" | 18 #include "base/time.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "net/base/auth.h" | 20 #include "net/base/auth.h" |
| 21 #include "net/base/net_log.h" | 21 #include "net/base/net_log.h" |
| 22 #include "net/http/http_request_headers.h" | 22 #include "net/http/http_request_headers.h" |
| 23 #include "net/http/http_response_headers.h" | 23 #include "net/http/http_response_headers.h" |
| 24 #include "webkit/glue/resource_type.h" |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class ListValue; | 27 class ListValue; |
| 27 class Value; | 28 class Value; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace extension_web_request_api_helpers { | 31 namespace extension_web_request_api_helpers { |
| 31 | 32 |
| 32 typedef std::pair<std::string, std::string> ResponseHeader; | 33 typedef std::pair<std::string, std::string> ResponseHeader; |
| 33 typedef std::vector<ResponseHeader> ResponseHeaders; | 34 typedef std::vector<ResponseHeader> ResponseHeaders; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Returns whether authentication credentials are set. | 175 // Returns whether authentication credentials are set. |
| 175 bool MergeOnAuthRequiredResponses( | 176 bool MergeOnAuthRequiredResponses( |
| 176 const EventResponseDeltas& deltas, | 177 const EventResponseDeltas& deltas, |
| 177 net::AuthCredentials* auth_credentials, | 178 net::AuthCredentials* auth_credentials, |
| 178 std::set<std::string>* conflicting_extensions, | 179 std::set<std::string>* conflicting_extensions, |
| 179 EventLogEntries* event_log_entries); | 180 EventLogEntries* event_log_entries); |
| 180 | 181 |
| 181 // Returns true if requests for |url| shall not be reported to extensions. | 182 // Returns true if requests for |url| shall not be reported to extensions. |
| 182 bool HideRequestForURL(const GURL& url); | 183 bool HideRequestForURL(const GURL& url); |
| 183 | 184 |
| 185 // Returns whether |type| is a ResourceType that is handled by the web request |
| 186 // API. |
| 187 bool IsRelevantResourceType(ResourceType::Type type); |
| 188 |
| 189 // Returns a string representation of |type| or |other| if |type| is not handled |
| 190 // by the web request API. |
| 191 const char* ResourceTypeToString(ResourceType::Type type); |
| 192 |
| 193 // Stores a |ResourceType::Type| representation in |type| if |type_str| is |
| 194 // a resource type handled by the web request API. Returns true in case of |
| 195 // success. |
| 196 bool ParseResourceType(const std::string& type_str, |
| 197 ResourceType::Type* type); |
| 198 |
| 184 } // namespace extension_web_request_api_helpers | 199 } // namespace extension_web_request_api_helpers |
| 185 | 200 |
| 186 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 201 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| OLD | NEW |