| 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 27 matching lines...) Expand all Loading... |
| 38 const base::DictionaryValue& localized_strings) override; | 38 const base::DictionaryValue& localized_strings) override; |
| 39 void AddBoolean(const std::string& name, bool value) override; | 39 void AddBoolean(const std::string& name, bool value) override; |
| 40 void AddInteger(const std::string& name, int32_t value) override; | 40 void AddInteger(const std::string& name, int32_t value) override; |
| 41 void SetJsonPath(const std::string& path) override; | 41 void SetJsonPath(const std::string& path) override; |
| 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 OverrideContentSecurityPolicyObjectSrc(const std::string& data) override; | 49 void OverrideContentSecurityPolicyObjectSrc(const std::string& data) override; |
| 49 void OverrideContentSecurityPolicyChildSrc(const std::string& data) override; | 50 void OverrideContentSecurityPolicyChildSrc(const std::string& data) override; |
| 50 void DisableDenyXFrameOptions() override; | 51 void DisableDenyXFrameOptions() override; |
| 51 void DisableI18nAndUseGzipForAllPaths() override; | 52 void DisableI18nAndUseGzipForAllPaths() override; |
| 52 | 53 |
| 53 // When DisableI18nAndUseGzipForAllPaths is enabled, exclude the given |path|. | 54 // When DisableI18nAndUseGzipForAllPaths is enabled, exclude the given |path|. |
| 54 void ExcludePathFromGzip(const std::string& path); | 55 void ExcludePathFromGzip(const std::string& path); |
| 55 | 56 |
| 56 protected: | 57 protected: |
| 57 ~WebUIDataSourceImpl() override; | 58 ~WebUIDataSourceImpl() override; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 std::string json_path_; | 91 std::string json_path_; |
| 91 std::map<std::string, int> path_to_idr_map_; | 92 std::map<std::string, int> path_to_idr_map_; |
| 92 std::unordered_set<std::string> excluded_paths_; | 93 std::unordered_set<std::string> excluded_paths_; |
| 93 // The |replacements_| is intended to replace |localized_strings_|. | 94 // The |replacements_| is intended to replace |localized_strings_|. |
| 94 // TODO(dschuyler): phase out |localized_strings_| in Q1 2016. (Or rename | 95 // TODO(dschuyler): phase out |localized_strings_| in Q1 2016. (Or rename |
| 95 // to |load_time_flags_| if the usage is reduced to storing flags only). | 96 // to |load_time_flags_| if the usage is reduced to storing flags only). |
| 96 ui::TemplateReplacements replacements_; | 97 ui::TemplateReplacements replacements_; |
| 97 base::DictionaryValue localized_strings_; | 98 base::DictionaryValue localized_strings_; |
| 98 WebUIDataSource::HandleRequestCallback filter_callback_; | 99 WebUIDataSource::HandleRequestCallback filter_callback_; |
| 99 bool add_csp_; | 100 bool add_csp_; |
| 101 bool script_src_set_; |
| 102 std::string script_src_; |
| 100 bool object_src_set_; | 103 bool object_src_set_; |
| 101 std::string object_src_; | 104 std::string object_src_; |
| 102 bool frame_src_set_; | 105 bool frame_src_set_; |
| 103 std::string frame_src_; | 106 std::string frame_src_; |
| 104 bool deny_xframe_options_; | 107 bool deny_xframe_options_; |
| 105 bool add_load_time_data_defaults_; | 108 bool add_load_time_data_defaults_; |
| 106 bool replace_existing_source_; | 109 bool replace_existing_source_; |
| 107 bool use_gzip_for_all_paths_; | 110 bool use_gzip_for_all_paths_; |
| 108 | 111 |
| 109 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); | 112 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 } // namespace content | 115 } // namespace content |
| 113 | 116 |
| 114 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 117 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
| OLD | NEW |