| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Helper functions used for the WebRequest API. | |
| 6 | |
| 7 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_UTILS_H_ | |
| 8 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_UTILS_H_ | |
| 9 | |
| 10 #include <string> | |
| 11 | |
| 12 #include "content/public/common/resource_type.h" | |
| 13 | |
| 14 using content::ResourceType; | |
| 15 | |
| 16 namespace extension_web_request_api_utils { | |
| 17 | |
| 18 // Returns whether |type| is a ResourceType that is handled by the web request | |
| 19 // API. | |
| 20 bool IsRelevantResourceType(content::ResourceType type); | |
| 21 | |
| 22 // Returns a string representation of |type| or |other| if |type| is not handled | |
| 23 // by the web request API. | |
| 24 const char* ResourceTypeToString(content::ResourceType type); | |
| 25 | |
| 26 // Stores a |content::ResourceType| representation in |type| if |type_str| is | |
| 27 // a resource type handled by the web request API. Returns true in case of | |
| 28 // success. | |
| 29 bool ParseResourceType(const std::string& type_str, | |
| 30 content::ResourceType* type); | |
| 31 | |
| 32 } // namespace extension_web_request_api_utils | |
| 33 | |
| 34 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_UTILS_H_ | |
| OLD | NEW |