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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // Add strings from |localized_strings| to our dictionary. | 49 // Add strings from |localized_strings| to our dictionary. |
50 virtual void AddLocalizedStrings( | 50 virtual void AddLocalizedStrings( |
51 const base::DictionaryValue& localized_strings) = 0; | 51 const base::DictionaryValue& localized_strings) = 0; |
52 | 52 |
53 // Adds a boolean keyed to its name to our dictionary. | 53 // Adds a boolean keyed to its name to our dictionary. |
54 virtual void AddBoolean(const std::string& name, bool value) = 0; | 54 virtual void AddBoolean(const std::string& name, bool value) = 0; |
55 | 55 |
56 // Sets the path which will return the JSON strings. | 56 // Sets the path which will return the JSON strings. |
57 virtual void SetJsonPath(const std::string& path) = 0; | 57 virtual void SetJsonPath(const std::string& path) = 0; |
58 | 58 |
59 // Sets the data source to use a slightly different format for json data. Some | |
60 // day this should become the default. | |
61 virtual void SetUseJsonJSFormatV2() = 0; | |
62 | |
63 // Adds a mapping between a path name and a resource to return. | 59 // Adds a mapping between a path name and a resource to return. |
64 virtual void AddResourcePath(const std::string& path, int resource_id) = 0; | 60 virtual void AddResourcePath(const std::string& path, int resource_id) = 0; |
65 | 61 |
66 // Sets the resource to returned when no other paths match. | 62 // Sets the resource to returned when no other paths match. |
67 virtual void SetDefaultResource(int resource_id) = 0; | 63 virtual void SetDefaultResource(int resource_id) = 0; |
68 | 64 |
69 // Used as a parameter to GotDataCallback. The caller has to run this callback | 65 // Used as a parameter to GotDataCallback. The caller has to run this callback |
70 // with the result for the path that they filtered, passing ownership of the | 66 // with the result for the path that they filtered, passing ownership of the |
71 // memory. | 67 // memory. |
72 typedef base::Callback<void(base::RefCountedMemory*)> GotDataCallback; | 68 typedef base::Callback<void(base::RefCountedMemory*)> GotDataCallback; |
(...skipping 19 matching lines...) Expand all Loading... |
92 virtual void OverrideContentSecurityPolicyObjectSrc( | 88 virtual void OverrideContentSecurityPolicyObjectSrc( |
93 const std::string& data) = 0; | 89 const std::string& data) = 0; |
94 virtual void OverrideContentSecurityPolicyFrameSrc( | 90 virtual void OverrideContentSecurityPolicyFrameSrc( |
95 const std::string& data) = 0; | 91 const std::string& data) = 0; |
96 virtual void DisableDenyXFrameOptions() = 0; | 92 virtual void DisableDenyXFrameOptions() = 0; |
97 }; | 93 }; |
98 | 94 |
99 } // namespace content | 95 } // namespace content |
100 | 96 |
101 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 97 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
OLD | NEW |