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 #include "content/browser/webui/web_ui_data_source_impl.h" | 5 #include "content/browser/webui/web_ui_data_source_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 void WebUIDataSourceImpl::OverrideContentSecurityPolicyChildSrc( | 213 void WebUIDataSourceImpl::OverrideContentSecurityPolicyChildSrc( |
214 const std::string& data) { | 214 const std::string& data) { |
215 frame_src_set_ = true; | 215 frame_src_set_ = true; |
216 frame_src_ = data; | 216 frame_src_ = data; |
217 } | 217 } |
218 | 218 |
219 void WebUIDataSourceImpl::DisableDenyXFrameOptions() { | 219 void WebUIDataSourceImpl::DisableDenyXFrameOptions() { |
220 deny_xframe_options_ = false; | 220 deny_xframe_options_ = false; |
221 } | 221 } |
222 | 222 |
223 void WebUIDataSourceImpl::DisableI18nAndUseGzipForAllPaths() { | 223 void WebUIDataSourceImpl::UseGzipForAllPaths() { |
224 use_gzip_for_all_paths_ = true; | 224 use_gzip_for_all_paths_ = true; |
225 } | 225 } |
226 | 226 |
227 const ui::TemplateReplacements* WebUIDataSourceImpl::GetReplacements() const { | 227 const ui::TemplateReplacements* WebUIDataSourceImpl::GetReplacements() const { |
228 return &replacements_; | 228 return &replacements_; |
229 } | 229 } |
230 | 230 |
231 void WebUIDataSourceImpl::EnsureLoadTimeDataDefaultsAdded() { | 231 void WebUIDataSourceImpl::EnsureLoadTimeDataDefaultsAdded() { |
232 if (!add_load_time_data_defaults_) | 232 if (!add_load_time_data_defaults_) |
233 return; | 233 return; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 295 } |
296 | 296 |
297 void WebUIDataSourceImpl::SendLocalizedStringsAsJSON( | 297 void WebUIDataSourceImpl::SendLocalizedStringsAsJSON( |
298 const URLDataSource::GotDataCallback& callback) { | 298 const URLDataSource::GotDataCallback& callback) { |
299 std::string template_data; | 299 std::string template_data; |
300 webui::AppendJsonJS(&localized_strings_, &template_data); | 300 webui::AppendJsonJS(&localized_strings_, &template_data); |
301 callback.Run(base::RefCountedString::TakeString(&template_data)); | 301 callback.Run(base::RefCountedString::TakeString(&template_data)); |
302 } | 302 } |
303 | 303 |
304 } // namespace content | 304 } // namespace content |
OLD | NEW |