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

Side by Side Diff: examples/pdf_viewer/pdf_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, 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 "base/strings/string_tokenizer.h" 5 #include "base/strings/string_tokenizer.h"
6 #include "examples/bitmap_uploader/bitmap_uploader.h" 6 #include "examples/bitmap_uploader/bitmap_uploader.h"
7 #include "mojo/application/application_runner_chromium.h" 7 #include "mojo/application/application_runner_chromium.h"
8 #include "mojo/application/content_handler_factory.h" 8 #include "mojo/application/content_handler_factory.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 private: 223 private:
224 // Overridden from ApplicationDelegate: 224 // Overridden from ApplicationDelegate:
225 virtual bool ConfigureIncomingConnection( 225 virtual bool ConfigureIncomingConnection(
226 ApplicationConnection* connection) override { 226 ApplicationConnection* connection) override {
227 connection->AddService(&content_handler_factory_); 227 connection->AddService(&content_handler_factory_);
228 return true; 228 return true;
229 } 229 }
230 230
231 // Overridden from ContentHandlerFactory::ManagedDelegate: 231 // Overridden from ContentHandlerFactory::ManagedDelegate:
232 virtual scoped_ptr<ContentHandlerFactory::HandledApplicationHolder> 232 virtual scoped_ptr<ContentHandlerFactory::HandledApplicationHolder>
233 CreateApplication(ShellPtr shell, URLResponsePtr response) override { 233 CreateApplication(InterfaceRequest<Application> application_request,
234 return make_handled_factory_holder( 234 URLResponsePtr response) override {
235 new mojo::ApplicationImpl(new PDFView(response.Pass()), shell.Pass())); 235 return make_handled_factory_holder(new mojo::ApplicationImpl(
236 new PDFView(response.Pass()), application_request.Pass()));
236 } 237 }
237 238
238 ContentHandlerFactory content_handler_factory_; 239 ContentHandlerFactory content_handler_factory_;
239 240
240 DISALLOW_COPY_AND_ASSIGN(PDFViewer); 241 DISALLOW_COPY_AND_ASSIGN(PDFViewer);
241 }; 242 };
242 243
243 } // namespace examples 244 } // namespace examples
244 } // namespace mojo 245 } // namespace mojo
245 246
246 MojoResult MojoMain(MojoHandle shell_handle) { 247 MojoResult MojoMain(MojoHandle shell_handle) {
247 mojo::ApplicationRunnerChromium runner(new mojo::examples::PDFViewer()); 248 mojo::ApplicationRunnerChromium runner(new mojo::examples::PDFViewer());
248 return runner.Run(shell_handle); 249 return runner.Run(shell_handle);
249 } 250 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698