| 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/public/common/content_client.h" | 12 #include "content/public/common/content_client.h" |
| 13 #include "grit/content_resources.h" | 13 #include "grit/content_resources.h" |
| 14 #include "ui/base/webui/jstemplate_builder.h" | 14 #include "ui/base/webui/jstemplate_builder.h" |
| 15 #include "ui/base/webui/web_ui_util.h" | 15 #include "ui/base/webui/web_ui_util.h" |
| 16 | 16 |
| 17 #if defined(USE_MOJO) | 17 #if defined(USE_MOJO) |
| 18 #include "mojo/public/bindings/js/constants.h" | 18 #include "mojo/public/js/bindings/constants.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 WebUIDataSource* WebUIDataSource::Create(const std::string& source_name) { | 24 WebUIDataSource* WebUIDataSource::Create(const std::string& source_name) { |
| 25 return new WebUIDataSourceImpl(source_name); | 25 return new WebUIDataSourceImpl(source_name); |
| 26 } | 26 } |
| 27 | 27 |
| 28 #if defined(USE_MOJO) | 28 #if defined(USE_MOJO) |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 } | 254 } |
| 255 | 255 |
| 256 void WebUIDataSourceImpl::SendFromResourceBundle( | 256 void WebUIDataSourceImpl::SendFromResourceBundle( |
| 257 const URLDataSource::GotDataCallback& callback, int idr) { | 257 const URLDataSource::GotDataCallback& callback, int idr) { |
| 258 scoped_refptr<base::RefCountedStaticMemory> response( | 258 scoped_refptr<base::RefCountedStaticMemory> response( |
| 259 GetContentClient()->GetDataResourceBytes(idr)); | 259 GetContentClient()->GetDataResourceBytes(idr)); |
| 260 callback.Run(response.get()); | 260 callback.Run(response.get()); |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace content | 263 } // namespace content |
| OLD | NEW |