| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/webui/web_ui_ios_data_source_impl.h" | 5 #include "ios/web/webui/web_ui_ios_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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 webui::SetLoadTimeDataDefaults(web::GetWebClient()->GetApplicationLocale(), | 147 webui::SetLoadTimeDataDefaults(web::GetWebClient()->GetApplicationLocale(), |
| 148 &localized_strings_); | 148 &localized_strings_); |
| 149 | 149 |
| 150 webui::AppendJsonJS(&localized_strings_, &template_data); | 150 webui::AppendJsonJS(&localized_strings_, &template_data); |
| 151 callback.Run(base::RefCountedString::TakeString(&template_data)); | 151 callback.Run(base::RefCountedString::TakeString(&template_data)); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void WebUIIOSDataSourceImpl::SendFromResourceBundle( | 154 void WebUIIOSDataSourceImpl::SendFromResourceBundle( |
| 155 const URLDataSourceIOS::GotDataCallback& callback, | 155 const URLDataSourceIOS::GotDataCallback& callback, |
| 156 int idr) { | 156 int idr) { |
| 157 scoped_refptr<base::RefCountedStaticMemory> response( | 157 scoped_refptr<base::RefCountedMemory> response( |
| 158 GetWebClient()->GetDataResourceBytes(idr)); | 158 GetWebClient()->GetDataResourceBytes(idr)); |
| 159 callback.Run(response); | 159 callback.Run(response); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace web | 162 } // namespace web |
| OLD | NEW |