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 #ifndef CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
6 #define CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 void AddResourcePath(const std::string& path, int resource_id) override; | 42 void AddResourcePath(const std::string& path, int resource_id) override; |
43 void SetDefaultResource(int resource_id) override; | 43 void SetDefaultResource(int resource_id) override; |
44 void SetRequestFilter( | 44 void SetRequestFilter( |
45 const WebUIDataSource::HandleRequestCallback& callback) override; | 45 const WebUIDataSource::HandleRequestCallback& callback) override; |
46 void DisableReplaceExistingSource() override; | 46 void DisableReplaceExistingSource() override; |
47 void DisableContentSecurityPolicy() override; | 47 void DisableContentSecurityPolicy() override; |
48 void OverrideContentSecurityPolicyScriptSrc(const std::string& data) override; | 48 void OverrideContentSecurityPolicyScriptSrc(const std::string& data) override; |
49 void OverrideContentSecurityPolicyObjectSrc(const std::string& data) override; | 49 void OverrideContentSecurityPolicyObjectSrc(const std::string& data) override; |
50 void OverrideContentSecurityPolicyChildSrc(const std::string& data) override; | 50 void OverrideContentSecurityPolicyChildSrc(const std::string& data) override; |
51 void DisableDenyXFrameOptions() override; | 51 void DisableDenyXFrameOptions() override; |
52 void DisableI18nAndUseGzipForAllPaths() override; | 52 void UseGzipForAllPaths() override; |
53 const ui::TemplateReplacements* GetReplacements() const override; | 53 const ui::TemplateReplacements* GetReplacements() const override; |
| 54 void ExcludePathFromGzip(const std::string& path) override; |
54 | 55 |
55 // Add the locale to the load time data defaults. May be called repeatedly. | 56 // Add the locale to the load time data defaults. May be called repeatedly. |
56 void EnsureLoadTimeDataDefaultsAdded(); | 57 void EnsureLoadTimeDataDefaultsAdded(); |
57 | 58 |
58 // When DisableI18nAndUseGzipForAllPaths is enabled, exclude the given |path|. | |
59 void ExcludePathFromGzip(const std::string& path); | |
60 | |
61 bool IsWebUIDataSourceImpl() const override; | 59 bool IsWebUIDataSourceImpl() const override; |
62 | 60 |
63 protected: | 61 protected: |
64 ~WebUIDataSourceImpl() override; | 62 ~WebUIDataSourceImpl() override; |
65 | 63 |
66 // Completes a request by sending our dictionary of localized strings. | 64 // Completes a request by sending our dictionary of localized strings. |
67 void SendLocalizedStringsAsJSON( | 65 void SendLocalizedStringsAsJSON( |
68 const URLDataSource::GotDataCallback& callback); | 66 const URLDataSource::GotDataCallback& callback); |
69 | 67 |
70 private: | 68 private: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 bool add_load_time_data_defaults_; | 115 bool add_load_time_data_defaults_; |
118 bool replace_existing_source_; | 116 bool replace_existing_source_; |
119 bool use_gzip_for_all_paths_; | 117 bool use_gzip_for_all_paths_; |
120 | 118 |
121 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); | 119 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); |
122 }; | 120 }; |
123 | 121 |
124 } // namespace content | 122 } // namespace content |
125 | 123 |
126 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 124 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
OLD | NEW |