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

Unified Diff: chrome/browser/ui/webui/mojo_web_ui_controller.cc

Issue 302573002: Add a Javascript wrapper around ServiceRegistry and expose it to WebUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render-view-shell
Patch Set: address comments Created 6 years, 5 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 | « chrome/browser/ui/webui/mojo_web_ui_controller.h ('k') | chrome/browser/ui/webui/omnibox/omnibox_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/mojo_web_ui_controller.cc
diff --git a/chrome/browser/ui/webui/mojo_web_ui_controller.cc b/chrome/browser/ui/webui/mojo_web_ui_controller.cc
index 574bb61f1700fa4ccff9ac73f2747e90b22343a4..286fcc1c4d9d8d350f4487ed499a14f75088be6c 100644
--- a/chrome/browser/ui/webui/mojo_web_ui_controller.cc
+++ b/chrome/browser/ui/webui/mojo_web_ui_controller.cc
@@ -6,40 +6,28 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/mojo_web_ui_handler.h"
-#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/bindings_policy.h"
-#include "content/public/common/service_registry.h"
#include "mojo/public/cpp/system/core.h"
-MojoWebUIController::MojoWebUIController(content::WebUI* contents)
- : WebUIController(contents), mojo_data_source_(NULL), weak_factory_(this) {
+MojoWebUIControllerBase::MojoWebUIControllerBase(content::WebUI* contents)
+ : WebUIController(contents), mojo_data_source_(NULL) {
}
-MojoWebUIController::~MojoWebUIController() {
+MojoWebUIControllerBase::~MojoWebUIControllerBase() {
}
-void MojoWebUIController::RenderViewCreated(
+void MojoWebUIControllerBase::RenderViewCreated(
content::RenderViewHost* render_view_host) {
render_view_host->AllowBindings(content::BINDINGS_POLICY_WEB_UI);
- render_view_host->GetMainFrame()->GetServiceRegistry()->AddService(
- "webui_controller",
- base::Bind(&MojoWebUIController::CreateAndStoreUIHandler,
- weak_factory_.GetWeakPtr()));
}
-void MojoWebUIController::AddMojoResourcePath(const std::string& path,
- int resource_id) {
+void MojoWebUIControllerBase::AddMojoResourcePath(const std::string& path,
+ int resource_id) {
if (!mojo_data_source_) {
mojo_data_source_ = content::WebUIDataSource::AddMojoDataSource(
Profile::FromWebUI(web_ui()));
}
mojo_data_source_->AddResourcePath(path, resource_id);
}
-
-void MojoWebUIController::CreateAndStoreUIHandler(
- mojo::ScopedMessagePipeHandle handle) {
- ui_handler_ = CreateUIHandler(handle.Pass());
-}
« no previous file with comments | « chrome/browser/ui/webui/mojo_web_ui_controller.h ('k') | chrome/browser/ui/webui/omnibox/omnibox_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698