| 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 <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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |