OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 : pdf_library_(pdf_library), pdf_document_(pdf_document) { | 265 : pdf_library_(pdf_library), pdf_document_(pdf_document) { |
266 DCHECK(pdf_library_); | 266 DCHECK(pdf_library_); |
267 DCHECK(pdf_document_); | 267 DCHECK(pdf_document_); |
268 } | 268 } |
269 | 269 |
270 ~PDFContentViewProviderApp() override {} | 270 ~PDFContentViewProviderApp() override {} |
271 | 271 |
272 void CreateView( | 272 void CreateView( |
273 const std::string& connection_url, | 273 const std::string& connection_url, |
274 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, | 274 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, |
275 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 275 mojo::InterfaceRequest<mojo::ServiceProvider> services) override { |
276 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services) override { | |
277 new PDFDocumentView(mojo::CreateApplicationConnector(app_impl()->shell()), | 276 new PDFDocumentView(mojo::CreateApplicationConnector(app_impl()->shell()), |
278 view_owner_request.Pass(), pdf_document_); | 277 view_owner_request.Pass(), pdf_document_); |
279 } | 278 } |
280 | 279 |
281 private: | 280 private: |
282 std::shared_ptr<PDFLibrary> pdf_library_; | 281 std::shared_ptr<PDFLibrary> pdf_library_; |
283 std::shared_ptr<PDFDocument> pdf_document_; | 282 std::shared_ptr<PDFDocument> pdf_document_; |
284 | 283 |
285 DISALLOW_COPY_AND_ASSIGN(PDFContentViewProviderApp); | 284 DISALLOW_COPY_AND_ASSIGN(PDFContentViewProviderApp); |
286 }; | 285 }; |
(...skipping 22 matching lines...) Expand all Loading... |
309 | 308 |
310 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp); | 309 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp); |
311 }; | 310 }; |
312 | 311 |
313 } // namespace examples | 312 } // namespace examples |
314 | 313 |
315 MojoResult MojoMain(MojoHandle application_request) { | 314 MojoResult MojoMain(MojoHandle application_request) { |
316 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp()); | 315 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp()); |
317 return runner.Run(application_request); | 316 return runner.Run(application_request); |
318 } | 317 } |
OLD | NEW |