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

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

Issue 352013002: Revert 279557 "Support exposing Mojo services between render fra..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 | « trunk/src/chrome/browser/ui/webui/mojo_web_ui_controller.h ('k') | trunk/src/chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/ui/webui/mojo_web_ui_controller.cc
===================================================================
--- trunk/src/chrome/browser/ui/webui/mojo_web_ui_controller.cc (revision 279559)
+++ trunk/src/chrome/browser/ui/webui/mojo_web_ui_controller.cc (working copy)
@@ -6,16 +6,14 @@
#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) {
+ : WebUIController(contents),
+ mojo_data_source_(NULL) {
}
MojoWebUIController::~MojoWebUIController() {
@@ -24,10 +22,10 @@
void MojoWebUIController::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()));
+
+ mojo::MessagePipe pipe;
+ ui_handler_ = CreateUIHandler(pipe.handle0.Pass());
+ render_view_host->SetWebUIHandle(pipe.handle1.Pass());
}
void MojoWebUIController::AddMojoResourcePath(const std::string& path,
@@ -38,8 +36,3 @@
}
mojo_data_source_->AddResourcePath(path, resource_id);
}
-
-void MojoWebUIController::CreateAndStoreUIHandler(
- mojo::ScopedMessagePipeHandle handle) {
- ui_handler_ = CreateUIHandler(handle.Pass());
-}
« no previous file with comments | « trunk/src/chrome/browser/ui/webui/mojo_web_ui_controller.h ('k') | trunk/src/chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698