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

Side by Side Diff: examples/ui/pdf_viewer/pdf_viewer.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: delay InterfacePtr::Create() until you actually need an InterfacePtr. GetProxy() and ConnectToAppl… 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 unified diff | Download patch
OLDNEW
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 : pdf_library_(pdf_library), pdf_document_(pdf_document) { 252 : pdf_library_(pdf_library), pdf_document_(pdf_document) {
253 DCHECK(pdf_library_); 253 DCHECK(pdf_library_);
254 DCHECK(pdf_document_); 254 DCHECK(pdf_document_);
255 } 255 }
256 256
257 ~PDFContentViewProviderApp() override {} 257 ~PDFContentViewProviderApp() override {}
258 258
259 bool CreateView( 259 bool CreateView(
260 const std::string& connection_url, 260 const std::string& connection_url,
261 mojo::InterfaceRequest<mojo::ServiceProvider> services, 261 mojo::InterfaceRequest<mojo::ServiceProvider> services,
262 mojo::ServiceProviderPtr exposed_services, 262 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services,
263 const mojo::ui::ViewProvider::CreateViewCallback& callback) override { 263 const mojo::ui::ViewProvider::CreateViewCallback& callback) override {
264 new PDFDocumentView(app_impl(), pdf_document_, callback); 264 new PDFDocumentView(app_impl(), pdf_document_, callback);
265 return true; 265 return true;
266 } 266 }
267 267
268 private: 268 private:
269 std::shared_ptr<PDFLibrary> pdf_library_; 269 std::shared_ptr<PDFLibrary> pdf_library_;
270 std::shared_ptr<PDFDocument> pdf_document_; 270 std::shared_ptr<PDFDocument> pdf_document_;
271 271
272 DISALLOW_COPY_AND_ASSIGN(PDFContentViewProviderApp); 272 DISALLOW_COPY_AND_ASSIGN(PDFContentViewProviderApp);
(...skipping 23 matching lines...) Expand all
296 296
297 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp); 297 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp);
298 }; 298 };
299 299
300 } // namespace examples 300 } // namespace examples
301 301
302 MojoResult MojoMain(MojoHandle application_request) { 302 MojoResult MojoMain(MojoHandle application_request) {
303 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp()); 303 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp());
304 return runner.Run(application_request); 304 return runner.Run(application_request);
305 } 305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698