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

Side by Side Diff: chrome/browser/ui/webui/engagement/site_engagement_ui.cc

Issue 1467133004: Revert of Serve mojo WebUI resources from the same origin as the WebUI itself. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/mojo_web_ui_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/engagement/site_engagement_ui.h" 5 #include "chrome/browser/ui/webui/engagement/site_engagement_ui.h"
6 6
7 #include "chrome/browser/engagement/site_engagement_service.h" 7 #include "chrome/browser/engagement/site_engagement_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "content/public/browser/web_ui.h" 10 #include "content/public/browser/web_ui.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Set up the chrome://site-engagement/ source. 63 // Set up the chrome://site-engagement/ source.
64 scoped_ptr<content::WebUIDataSource> source( 64 scoped_ptr<content::WebUIDataSource> source(
65 content::WebUIDataSource::Create(chrome::kChromeUISiteEngagementHost)); 65 content::WebUIDataSource::Create(chrome::kChromeUISiteEngagementHost));
66 source->AddResourcePath("engagement_table.html", 66 source->AddResourcePath("engagement_table.html",
67 IDR_SITE_ENGAGEMENT_ENGAGEMENT_TABLE_HTML); 67 IDR_SITE_ENGAGEMENT_ENGAGEMENT_TABLE_HTML);
68 source->AddResourcePath("engagement_table.css", 68 source->AddResourcePath("engagement_table.css",
69 IDR_SITE_ENGAGEMENT_ENGAGEMENT_TABLE_CSS); 69 IDR_SITE_ENGAGEMENT_ENGAGEMENT_TABLE_CSS);
70 source->AddResourcePath("engagement_table.js", 70 source->AddResourcePath("engagement_table.js",
71 IDR_SITE_ENGAGEMENT_ENGAGEMENT_TABLE_JS); 71 IDR_SITE_ENGAGEMENT_ENGAGEMENT_TABLE_JS);
72 source->AddResourcePath("site_engagement.js", IDR_SITE_ENGAGEMENT_JS); 72 source->AddResourcePath("site_engagement.js", IDR_SITE_ENGAGEMENT_JS);
73 source->AddResourcePath(
74 "chrome/browser/ui/webui/engagement/site_engagement.mojom",
75 IDR_SITE_ENGAGEMENT_MOJO_JS);
76 source->AddMojoResources();
77 source->SetDefaultResource(IDR_SITE_ENGAGEMENT_HTML); 73 source->SetDefaultResource(IDR_SITE_ENGAGEMENT_HTML);
78 74
79 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source.release()); 75 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source.release());
76
77 AddMojoResourcePath(
78 "chrome/browser/ui/webui/engagement/site_engagement.mojom",
79 IDR_SITE_ENGAGEMENT_MOJO_JS);
80 } 80 }
81 81
82 SiteEngagementUI::~SiteEngagementUI() {} 82 SiteEngagementUI::~SiteEngagementUI() {}
83 83
84 void SiteEngagementUI::BindUIHandler( 84 void SiteEngagementUI::BindUIHandler(
85 mojo::InterfaceRequest<SiteEngagementUIHandler> request) { 85 mojo::InterfaceRequest<SiteEngagementUIHandler> request) {
86 // SiteEngagementUIHandlerImpl deletes itself when the pipe is closed. 86 // SiteEngagementUIHandlerImpl deletes itself when the pipe is closed.
87 new SiteEngagementUIHandlerImpl(Profile::FromWebUI(web_ui()), request.Pass()); 87 new SiteEngagementUIHandlerImpl(Profile::FromWebUI(web_ui()), request.Pass());
88 } 88 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/mojo_web_ui_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698