| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void StartDataRequest( | 71 void StartDataRequest( |
| 72 const std::string& path, | 72 const std::string& path, |
| 73 const ResourceRequestInfo::WebContentsGetter& wc_getter, | 73 const ResourceRequestInfo::WebContentsGetter& wc_getter, |
| 74 const URLDataSource::GotDataCallback& callback); | 74 const URLDataSource::GotDataCallback& callback); |
| 75 | 75 |
| 76 // Note: this must be called before StartDataRequest() to have an effect. | 76 // Note: this must be called before StartDataRequest() to have an effect. |
| 77 void disable_load_time_data_defaults_for_testing() { | 77 void disable_load_time_data_defaults_for_testing() { |
| 78 add_load_time_data_defaults_ = false; | 78 add_load_time_data_defaults_ = false; |
| 79 } | 79 } |
| 80 | 80 |
| 81 int GetResourceIdFromPath(const std::string& path) const; |
| 82 |
| 81 // The name of this source. | 83 // The name of this source. |
| 82 // E.g., for favicons, this could be "favicon", which results in paths for | 84 // E.g., for favicons, this could be "favicon", which results in paths for |
| 83 // specific resources like "favicon/34" getting sent to this source. | 85 // specific resources like "favicon/34" getting sent to this source. |
| 84 std::string source_name_; | 86 std::string source_name_; |
| 85 int default_resource_; | 87 int default_resource_; |
| 86 std::string json_path_; | 88 std::string json_path_; |
| 87 std::map<std::string, int> path_to_idr_map_; | 89 std::map<std::string, int> path_to_idr_map_; |
| 88 // The |replacements_| is intended to replace |localized_strings_|. | 90 // The |replacements_| is intended to replace |localized_strings_|. |
| 89 // TODO(dschuyler): phase out |localized_strings_| in Q1 2016. (Or rename | 91 // TODO(dschuyler): phase out |localized_strings_| in Q1 2016. (Or rename |
| 90 // to |load_time_flags_| if the usage is reduced to storing flags only). | 92 // to |load_time_flags_| if the usage is reduced to storing flags only). |
| 91 ui::TemplateReplacements replacements_; | 93 ui::TemplateReplacements replacements_; |
| 92 base::DictionaryValue localized_strings_; | 94 base::DictionaryValue localized_strings_; |
| 93 WebUIDataSource::HandleRequestCallback filter_callback_; | 95 WebUIDataSource::HandleRequestCallback filter_callback_; |
| 94 bool add_csp_; | 96 bool add_csp_; |
| 95 bool object_src_set_; | 97 bool object_src_set_; |
| 96 std::string object_src_; | 98 std::string object_src_; |
| 97 bool frame_src_set_; | 99 bool frame_src_set_; |
| 98 std::string frame_src_; | 100 std::string frame_src_; |
| 99 bool deny_xframe_options_; | 101 bool deny_xframe_options_; |
| 100 bool add_load_time_data_defaults_; | 102 bool add_load_time_data_defaults_; |
| 101 bool replace_existing_source_; | 103 bool replace_existing_source_; |
| 102 bool use_gzip_for_all_paths_; | 104 bool use_gzip_for_all_paths_; |
| 103 | 105 |
| 104 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); | 106 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); |
| 105 }; | 107 }; |
| 106 | 108 |
| 107 } // namespace content | 109 } // namespace content |
| 108 | 110 |
| 109 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 111 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
| OLD | NEW |