| 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" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "content/grit/content_resources.h" | 12 #include "content/grit/content_resources.h" |
| 13 #include "content/public/browser/content_browser_client.h" | 13 #include "content/public/browser/content_browser_client.h" |
| 14 #include "content/public/common/content_client.h" | 14 #include "content/public/common/content_client.h" |
| 15 #include "third_party/mojo/src/mojo/public/js/constants.h" | 15 #include "mojo/public/js/constants.h" |
| 16 #include "ui/base/webui/jstemplate_builder.h" | 16 #include "ui/base/webui/jstemplate_builder.h" |
| 17 #include "ui/base/webui/web_ui_util.h" | 17 #include "ui/base/webui/web_ui_util.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 WebUIDataSource* WebUIDataSource::Create(const std::string& source_name) { | 22 WebUIDataSource* WebUIDataSource::Create(const std::string& source_name) { |
| 23 return new WebUIDataSourceImpl(source_name); | 23 return new WebUIDataSourceImpl(source_name); |
| 24 } | 24 } |
| 25 | 25 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 245 } |
| 246 | 246 |
| 247 void WebUIDataSourceImpl::SendFromResourceBundle( | 247 void WebUIDataSourceImpl::SendFromResourceBundle( |
| 248 const URLDataSource::GotDataCallback& callback, int idr) { | 248 const URLDataSource::GotDataCallback& callback, int idr) { |
| 249 scoped_refptr<base::RefCountedStaticMemory> response( | 249 scoped_refptr<base::RefCountedStaticMemory> response( |
| 250 GetContentClient()->GetDataResourceBytes(idr)); | 250 GetContentClient()->GetDataResourceBytes(idr)); |
| 251 callback.Run(response.get()); | 251 callback.Run(response.get()); |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace content | 254 } // namespace content |
| OLD | NEW |