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

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

Issue 215743002: Mojo: update web ui for the addition of connection.js and router.js (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « no previous file | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bd4758ed02e72c027edaaff66875196d89d57bc6..353198842b05ab7403e276b8bfe1179c95070b6d 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -30,9 +30,19 @@ WebUIDataSource* WebUIDataSource::Create(const std::string& source_name) {
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);
+
+ static const struct {
+ const char* path;
+ int id;
+ } resources[] = {
+ { mojo::kCodecModuleName, IDR_MOJO_CODEC_JS },
+ { mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS },
+ { mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS },
+ { mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS },
+ };
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i)
+ mojo_source->AddResourcePath(resources[i].path, resources[i].id);
+
URLDataManager::AddWebUIDataSource(browser_context, mojo_source);
return mojo_source;
}
« no previous file with comments | « no previous file | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698