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

Side by Side Diff: examples/png_viewer/png_viewer.cc

Issue 868463008: Remove Client relationship between mojo.Shell/mojo.Application (Closed) Base URL: git@github.com:domokit/mojo.git@app_impl_init
Patch Set: fix android Created 5 years, 11 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_tokenizer.h" 10 #include "base/strings/string_tokenizer.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 private: 203 private:
204 // Overridden from ApplicationDelegate: 204 // Overridden from ApplicationDelegate:
205 virtual bool ConfigureIncomingConnection( 205 virtual bool ConfigureIncomingConnection(
206 ApplicationConnection* connection) override { 206 ApplicationConnection* connection) override {
207 connection->AddService(&content_handler_factory_); 207 connection->AddService(&content_handler_factory_);
208 return true; 208 return true;
209 } 209 }
210 210
211 // Overridden from ContentHandlerFactory::ManagedDelegate: 211 // Overridden from ContentHandlerFactory::ManagedDelegate:
212 virtual scoped_ptr<ContentHandlerFactory::HandledApplicationHolder> 212 virtual scoped_ptr<ContentHandlerFactory::HandledApplicationHolder>
213 CreateApplication(ShellPtr shell, URLResponsePtr response) override { 213 CreateApplication(InterfaceRequest<Application> application_request,
214 return make_handled_factory_holder( 214 URLResponsePtr response) override {
215 new mojo::ApplicationImpl(new PNGView(response.Pass()), shell.Pass())); 215 return make_handled_factory_holder(new mojo::ApplicationImpl(
216 new PNGView(response.Pass()), application_request.Pass()));
216 } 217 }
217 218
218 ContentHandlerFactory content_handler_factory_; 219 ContentHandlerFactory content_handler_factory_;
219 220
220 DISALLOW_COPY_AND_ASSIGN(PNGViewer); 221 DISALLOW_COPY_AND_ASSIGN(PNGViewer);
221 }; 222 };
222 223
223 } // namespace examples 224 } // namespace examples
224 } // namespace mojo 225 } // namespace mojo
225 226
226 MojoResult MojoMain(MojoHandle shell_handle) { 227 MojoResult MojoMain(MojoHandle shell_handle) {
227 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer()); 228 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer());
228 return runner.Run(shell_handle); 229 return runner.Run(shell_handle);
229 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698