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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Used by SetRequestFilter. The string parameter is the path of the request. | 65 // Used by SetRequestFilter. The string parameter is the path of the request. |
66 // If the callee doesn't want to handle the data, false is returned. Otherwise | 66 // If the callee doesn't want to handle the data, false is returned. Otherwise |
67 // true is returned and the GotDataCallback parameter is called either then or | 67 // true is returned and the GotDataCallback parameter is called either then or |
68 // asynchronously with the response. | 68 // asynchronously with the response. |
69 typedef base::Callback<bool(const std::string&, const GotDataCallback&)> | 69 typedef base::Callback<bool(const std::string&, const GotDataCallback&)> |
70 HandleRequestCallback; | 70 HandleRequestCallback; |
71 | 71 |
72 // Allows a caller to add a filter for URL requests. | 72 // Allows a caller to add a filter for URL requests. |
73 virtual void SetRequestFilter(const HandleRequestCallback& callback) = 0; | 73 virtual void SetRequestFilter(const HandleRequestCallback& callback) = 0; |
74 | 74 |
75 // Adds the necessary resources for mojo bindings. | |
76 virtual void AddMojoResources() = 0; | |
77 | |
78 // The following map to methods on URLDataSource. See the documentation there. | 75 // The following map to methods on URLDataSource. See the documentation there. |
79 // NOTE: it's not acceptable to call DisableContentSecurityPolicy for new | 76 // NOTE: it's not acceptable to call DisableContentSecurityPolicy for new |
80 // pages, see URLDataSource::ShouldAddContentSecurityPolicy and talk to | 77 // pages, see URLDataSource::ShouldAddContentSecurityPolicy and talk to |
81 // tsepez. | 78 // tsepez. |
82 | 79 |
83 // Currently only used by embedders for WebUIs with multiple instances. | 80 // Currently only used by embedders for WebUIs with multiple instances. |
84 virtual void DisableReplaceExistingSource() = 0; | 81 virtual void DisableReplaceExistingSource() = 0; |
85 virtual void DisableContentSecurityPolicy() = 0; | 82 virtual void DisableContentSecurityPolicy() = 0; |
86 virtual void OverrideContentSecurityPolicyObjectSrc( | 83 virtual void OverrideContentSecurityPolicyObjectSrc( |
87 const std::string& data) = 0; | 84 const std::string& data) = 0; |
88 virtual void OverrideContentSecurityPolicyFrameSrc( | 85 virtual void OverrideContentSecurityPolicyFrameSrc( |
89 const std::string& data) = 0; | 86 const std::string& data) = 0; |
90 virtual void DisableDenyXFrameOptions() = 0; | 87 virtual void DisableDenyXFrameOptions() = 0; |
91 }; | 88 }; |
92 | 89 |
93 } // namespace content | 90 } // namespace content |
94 | 91 |
95 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 92 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
OLD | NEW |