| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 frame_src_set_(false), | 88 frame_src_set_(false), |
| 89 deny_xframe_options_(true), | 89 deny_xframe_options_(true), |
| 90 disable_set_font_strings_(false), | 90 disable_set_font_strings_(false), |
| 91 replace_existing_source_(true) { | 91 replace_existing_source_(true) { |
| 92 } | 92 } |
| 93 | 93 |
| 94 WebUIDataSourceImpl::~WebUIDataSourceImpl() { | 94 WebUIDataSourceImpl::~WebUIDataSourceImpl() { |
| 95 } | 95 } |
| 96 | 96 |
| 97 void WebUIDataSourceImpl::AddString(const std::string& name, | 97 void WebUIDataSourceImpl::AddString(const std::string& name, |
| 98 const string16& value) { | 98 const base::string16& value) { |
| 99 localized_strings_.SetString(name, value); | 99 localized_strings_.SetString(name, value); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void WebUIDataSourceImpl::AddString(const std::string& name, | 102 void WebUIDataSourceImpl::AddString(const std::string& name, |
| 103 const std::string& value) { | 103 const std::string& value) { |
| 104 localized_strings_.SetString(name, value); | 104 localized_strings_.SetString(name, value); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void WebUIDataSourceImpl::AddLocalizedString(const std::string& name, | 107 void WebUIDataSourceImpl::AddLocalizedString(const std::string& name, |
| 108 int ids) { | 108 int ids) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 224 } |
| 225 | 225 |
| 226 void WebUIDataSourceImpl::SendFromResourceBundle( | 226 void WebUIDataSourceImpl::SendFromResourceBundle( |
| 227 const URLDataSource::GotDataCallback& callback, int idr) { | 227 const URLDataSource::GotDataCallback& callback, int idr) { |
| 228 scoped_refptr<base::RefCountedStaticMemory> response( | 228 scoped_refptr<base::RefCountedStaticMemory> response( |
| 229 GetContentClient()->GetDataResourceBytes(idr)); | 229 GetContentClient()->GetDataResourceBytes(idr)); |
| 230 callback.Run(response.get()); | 230 callback.Run(response.get()); |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace content | 233 } // namespace content |
| OLD | NEW |