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

Side by Side Diff: examples/ui/png_viewer/png_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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "mojo/application/application_runner_chromium.h" 10 #include "mojo/application/application_runner_chromium.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 public: 102 public:
103 PNGContentViewProviderApp(skia::RefPtr<SkImage> image) : image_(image) { 103 PNGContentViewProviderApp(skia::RefPtr<SkImage> image) : image_(image) {
104 DCHECK(image_); 104 DCHECK(image_);
105 } 105 }
106 106
107 ~PNGContentViewProviderApp() override {} 107 ~PNGContentViewProviderApp() override {}
108 108
109 bool CreateView( 109 bool CreateView(
110 const std::string& connection_url, 110 const std::string& connection_url,
111 mojo::InterfaceRequest<mojo::ServiceProvider> services, 111 mojo::InterfaceRequest<mojo::ServiceProvider> services,
112 mojo::ServiceProviderPtr exposed_services, 112 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services,
113 const mojo::ui::ViewProvider::CreateViewCallback& callback) override { 113 const mojo::ui::ViewProvider::CreateViewCallback& callback) override {
114 new PNGView(app_impl(), image_, callback); 114 new PNGView(app_impl(), image_, callback);
115 return true; 115 return true;
116 } 116 }
117 117
118 private: 118 private:
119 skia::RefPtr<SkImage> image_; 119 skia::RefPtr<SkImage> image_;
120 120
121 DISALLOW_COPY_AND_ASSIGN(PNGContentViewProviderApp); 121 DISALLOW_COPY_AND_ASSIGN(PNGContentViewProviderApp);
122 }; 122 };
(...skipping 25 matching lines...) Expand all
148 private: 148 private:
149 DISALLOW_COPY_AND_ASSIGN(PNGContentViewerApp); 149 DISALLOW_COPY_AND_ASSIGN(PNGContentViewerApp);
150 }; 150 };
151 151
152 } // namespace examples 152 } // namespace examples
153 153
154 MojoResult MojoMain(MojoHandle application_request) { 154 MojoResult MojoMain(MojoHandle application_request) {
155 mojo::ApplicationRunnerChromium runner(new examples::PNGContentViewerApp()); 155 mojo::ApplicationRunnerChromium runner(new examples::PNGContentViewerApp());
156 return runner.Run(application_request); 156 return runner.Run(application_request);
157 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698