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

Unified Diff: examples/ui/pdf_viewer/pdf_viewer.cc

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 | « examples/ui/noodles/noodles_view.cc ('k') | examples/ui/png_viewer/png_viewer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/ui/pdf_viewer/pdf_viewer.cc
diff --git a/examples/ui/pdf_viewer/pdf_viewer.cc b/examples/ui/pdf_viewer/pdf_viewer.cc
index ee760ab71f7e459a04a58558de1fcead76e76c5a..ce5c60593e90924caa258fc94775c90f91ec604a 100644
--- a/examples/ui/pdf_viewer/pdf_viewer.cc
+++ b/examples/ui/pdf_viewer/pdf_viewer.cc
@@ -117,9 +117,9 @@ class PDFDocumentView : public mojo::ui::GaneshView,
public:
PDFDocumentView(
mojo::ApplicationImpl* app_impl,
- const std::shared_ptr<PDFDocument>& pdf_document,
- const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback)
- : GaneshView(app_impl, "PDFDocumentViewer", create_view_callback),
+ mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
+ const std::shared_ptr<PDFDocument>& pdf_document)
+ : GaneshView(app_impl, view_owner_request.Pass(), "PDFDocumentViewer"),
pdf_document_(pdf_document),
choreographer_(scene(), this),
input_handler_(view_service_provider(), this) {
@@ -256,13 +256,12 @@ class PDFContentViewProviderApp : public mojo::ui::ViewProviderApp {
~PDFContentViewProviderApp() override {}
- bool CreateView(
+ void CreateView(
const std::string& connection_url,
+ mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
mojo::InterfaceRequest<mojo::ServiceProvider> services,
- mojo::ServiceProviderPtr exposed_services,
- const mojo::ui::ViewProvider::CreateViewCallback& callback) override {
- new PDFDocumentView(app_impl(), pdf_document_, callback);
- return true;
+ mojo::ServiceProviderPtr exposed_services) override {
+ new PDFDocumentView(app_impl(), view_owner_request.Pass(), pdf_document_);
}
private:
« no previous file with comments | « examples/ui/noodles/noodles_view.cc ('k') | examples/ui/png_viewer/png_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698