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 "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 5 #include "content/browser/webui/web_ui_data_source.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" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "content/public/common/content_client.h" | 12 #include "content/public/common/content_client.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/webui/jstemplate_builder.h" | 14 #include "ui/webui/jstemplate_builder.h" |
15 #include "ui/webui/web_ui_util.h" | 15 #include "ui/webui/web_ui_util.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 webui::AppendJsonJS(&localized_strings_, &template_data); | 198 webui::AppendJsonJS(&localized_strings_, &template_data); |
199 callback.Run(base::RefCountedString::TakeString(&template_data)); | 199 callback.Run(base::RefCountedString::TakeString(&template_data)); |
200 } | 200 } |
201 | 201 |
202 void ChromeWebUIDataSource::SendFromResourceBundle( | 202 void ChromeWebUIDataSource::SendFromResourceBundle( |
203 const content::URLDataSource::GotDataCallback& callback, int idr) { | 203 const content::URLDataSource::GotDataCallback& callback, int idr) { |
204 scoped_refptr<base::RefCountedStaticMemory> response( | 204 scoped_refptr<base::RefCountedStaticMemory> response( |
205 content::GetContentClient()->GetDataResourceBytes(idr)); | 205 content::GetContentClient()->GetDataResourceBytes(idr)); |
206 callback.Run(response); | 206 callback.Run(response); |
207 } | 207 } |
OLD | NEW |