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

Unified Diff: sky/viewer/document_view.cc

Issue 687273002: mojo: Update content handler API (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Add missing comment Created 6 years, 2 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 | « sky/viewer/document_view.h ('k') | sky/viewer/viewer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/document_view.cc
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
index d5754d75405afcd8b79b781b0e73166003bf4cb0..cac3398cf8a5edd2edf7ee770223ac701f58146d 100644
--- a/sky/viewer/document_view.cc
+++ b/sky/viewer/document_view.cc
@@ -12,7 +12,6 @@
#include "base/thread_task_runner_handle.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/public/cpp/application/connect.h"
-#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/public/cpp/view_manager/view.h"
@@ -67,20 +66,17 @@ mojo::Target WebNavigationPolicyToNavigationTarget(
DocumentView::DocumentView(
mojo::URLResponsePtr response,
- mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request,
- mojo::Shell* shell,
+ mojo::ShellPtr shell,
scoped_refptr<base::MessageLoopProxy> compositor_thread)
: response_(response.Pass()),
- shell_(shell),
+ shell_(shell.Pass()),
web_view_(NULL),
root_(NULL),
- view_manager_client_factory_(shell, this),
+ view_manager_client_factory_(shell_.get(), this),
inspector_service_factory_(this),
compositor_thread_(compositor_thread),
weak_factory_(this) {
- mojo::ServiceProviderImpl* exported_services = new mojo::ServiceProviderImpl();
- exported_services->AddService(&view_manager_client_factory_);
- BindToRequest(exported_services, &service_provider_request);
+ shell_.set_client(this);
}
DocumentView::~DocumentView() {
@@ -94,6 +90,15 @@ base::WeakPtr<DocumentView> DocumentView::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
+void DocumentView::AcceptConnection(const mojo::String& requestor_url,
+ mojo::ServiceProviderPtr provider) {
+ exported_services_.AddService(&view_manager_client_factory_);
+ mojo::WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
+}
+
+void DocumentView::Initialize(mojo::Array<mojo::String> args) {
+}
+
void DocumentView::OnEmbed(
mojo::ViewManager* view_manager,
mojo::View* root,
« no previous file with comments | « sky/viewer/document_view.h ('k') | sky/viewer/viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698