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

Unified Diff: chrome/browser/ui/webui/plugins/plugins_ui.cc

Issue 1576183003: chrome://plugins Mojo-ification part 2/2, populating the page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plugins_mojo1
Patch Set: More work Created 4 years, 11 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: chrome/browser/ui/webui/plugins/plugins_ui.cc
diff --git a/chrome/browser/ui/webui/plugins/plugins_ui.cc b/chrome/browser/ui/webui/plugins/plugins_ui.cc
index 7e1326d7dd837fc6d76870db33b5fc565d7e04e8..cf78ad59828bd517db663e8dbfd38d74258158d0 100644
--- a/chrome/browser/ui/webui/plugins/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins/plugins_ui.cc
@@ -69,20 +69,26 @@ content::WebUIDataSource* CreatePluginsUIHTMLSource(Profile* profile) {
#if defined(OS_CHROMEOS)
chromeos::AddAccountUITweaksLocalizedValues(source, profile);
#endif
+
+ source->AddResourcePath(
+ "chrome/browser/ui/webui/plugins/plugins.mojom", IDR_PLUGINS_MOJO_JS);
+ source->AddMojoResources();
+
return source;
}
} // namespace
-PluginsUI::PluginsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
- web_ui->AddMessageHandler(new PluginsHandler());
-
+PluginsUI::PluginsUI(content::WebUI* web_ui) : MojoWebUIController(web_ui) {
+ LOG(ERROR) << "PluginsUI";
// Set up the chrome://plugins/ source.
Profile* profile = Profile::FromWebUI(web_ui);
content::WebUIDataSource::Add(profile, CreatePluginsUIHTMLSource(profile));
}
+PluginsUI::~PluginsUI() {}
+
// static
base::RefCountedMemory* PluginsUI::GetFaviconResourceBytes(
ui::ScaleFactor scale_factor) {
@@ -98,3 +104,10 @@ void PluginsUI::RegisterProfilePrefs(
prefs::kContentSettingsPluginWhitelist,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
+
+void PluginsUI::BindUIHandler(
+ mojo::InterfaceRequest<PluginsHandlerMojo> request) {
+ // PluginsHandler deletes itself when the pipe is closed.
+ LOG(ERROR) << "bindUIHandler";
+ plugins_handler_.reset(new PluginsHandler(web_ui(), std::move(request)));
+}

Powered by Google App Engine
This is Rietveld 408576698