Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: content/browser/webui/web_ui_data_source_impl.cc

Issue 206923002: Adds plumbing to pass WebUI mojo::Handle from browser to renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO and merge to trunk Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/webui/web_ui_data_source_impl.cc
diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc
index d6cff75cd8fa1d8b272fe72c27b2fe47251d4a34..bd4758ed02e72c027edaaff66875196d89d57bc6 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -10,15 +10,35 @@
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.h"
#include "content/public/common/content_client.h"
+#include "grit/content_resources.h"
#include "ui/base/webui/jstemplate_builder.h"
#include "ui/base/webui/web_ui_util.h"
+#if defined(USE_MOJO)
+#include "mojo/public/bindings/js/constants.h"
+#endif
+
namespace content {
+// static
WebUIDataSource* WebUIDataSource::Create(const std::string& source_name) {
return new WebUIDataSourceImpl(source_name);
}
+#if defined(USE_MOJO)
+// static
+WebUIDataSource* WebUIDataSource::AddMojoDataSource(
+ BrowserContext* browser_context) {
+ WebUIDataSource* mojo_source = Create("mojo");
+ mojo_source->AddResourcePath(mojo::kCodecModuleName, IDR_MOJO_CODEC_JS);
+ mojo_source->AddResourcePath(mojo::kConnectorModuleName,
+ IDR_MOJO_CONNECTOR_JS);
+ URLDataManager::AddWebUIDataSource(browser_context, mojo_source);
+ return mojo_source;
+}
+#endif
+
+// static
void WebUIDataSource::Add(BrowserContext* browser_context,
WebUIDataSource* source) {
URLDataManager::AddWebUIDataSource(browser_context, source);
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698