| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 virtual void AddBoolean(const std::string& name, bool value) = 0; | 56 virtual void AddBoolean(const std::string& name, bool value) = 0; |
| 57 | 57 |
| 58 // Sets the path which will return the JSON strings. | 58 // Sets the path which will return the JSON strings. |
| 59 virtual void SetJsonPath(const std::string& path) = 0; | 59 virtual void SetJsonPath(const std::string& path) = 0; |
| 60 | 60 |
| 61 // Sets the data source to use a slightly different format for json data. Some | 61 // Sets the data source to use a slightly different format for json data. Some |
| 62 // day this should become the default. | 62 // day this should become the default. |
| 63 virtual void SetUseJsonJSFormatV2() = 0; | 63 virtual void SetUseJsonJSFormatV2() = 0; |
| 64 | 64 |
| 65 // Adds a mapping between a path name and a resource to return. | 65 // Adds a mapping between a path name and a resource to return. |
| 66 virtual void AddResourcePath(const std::string &path, int resource_id) = 0; | 66 virtual void AddResourcePath(const std::string& path, int resource_id) = 0; |
| 67 | 67 |
| 68 // Sets the resource to returned when no other paths match. | 68 // Sets the resource to returned when no other paths match. |
| 69 virtual void SetDefaultResource(int resource_id) = 0; | 69 virtual void SetDefaultResource(int resource_id) = 0; |
| 70 | 70 |
| 71 // Used as a parameter to GotDataCallback. The caller has to run this callback | 71 // Used as a parameter to GotDataCallback. The caller has to run this callback |
| 72 // with the result for the path that they filtered, passing ownership of the | 72 // with the result for the path that they filtered, passing ownership of the |
| 73 // memory. | 73 // memory. |
| 74 typedef base::Callback<void(base::RefCountedMemory*)> GotDataCallback; | 74 typedef base::Callback<void(base::RefCountedMemory*)> GotDataCallback; |
| 75 | 75 |
| 76 // Used by SetRequestFilter. The string parameter is the path of the request. | 76 // Used by SetRequestFilter. The string parameter is the path of the request. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 94 virtual void OverrideContentSecurityPolicyObjectSrc( | 94 virtual void OverrideContentSecurityPolicyObjectSrc( |
| 95 const std::string& data) = 0; | 95 const std::string& data) = 0; |
| 96 virtual void OverrideContentSecurityPolicyFrameSrc( | 96 virtual void OverrideContentSecurityPolicyFrameSrc( |
| 97 const std::string& data) = 0; | 97 const std::string& data) = 0; |
| 98 virtual void DisableDenyXFrameOptions() = 0; | 98 virtual void DisableDenyXFrameOptions() = 0; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace content | 101 } // namespace content |
| 102 | 102 |
| 103 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 103 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
| OLD | NEW |