OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mojo/ui/content_viewer_app.h" | 5 #include "mojo/ui/content_viewer_app.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 logging::InitLogging(settings); | 47 logging::InitLogging(settings); |
48 } | 48 } |
49 | 49 |
50 bool ContentViewerApp::ConfigureIncomingConnection( | 50 bool ContentViewerApp::ConfigureIncomingConnection( |
51 mojo::ApplicationConnection* connection) { | 51 mojo::ApplicationConnection* connection) { |
52 connection->AddService<mojo::ContentHandler>(this); | 52 connection->AddService<mojo::ContentHandler>(this); |
53 return true; | 53 return true; |
54 } | 54 } |
55 | 55 |
56 void ContentViewerApp::Create( | 56 void ContentViewerApp::Create( |
57 mojo::ApplicationConnection* connection, | 57 const mojo::ConnectionContext& connection_context, |
58 mojo::InterfaceRequest<mojo::ContentHandler> request) { | 58 mojo::InterfaceRequest<mojo::ContentHandler> request) { |
59 bindings_.AddBinding( | 59 bindings_.AddBinding( |
60 new DelegatingContentHandler(this, connection->GetConnectionURL()), | 60 new DelegatingContentHandler(this, connection_context.connection_url), |
61 request.Pass()); | 61 request.Pass()); |
62 } | 62 } |
63 | 63 |
64 void ContentViewerApp::StartViewer( | 64 void ContentViewerApp::StartViewer( |
65 const std::string& content_handler_url, | 65 const std::string& content_handler_url, |
66 mojo::InterfaceRequest<mojo::Application> application_request, | 66 mojo::InterfaceRequest<mojo::Application> application_request, |
67 mojo::URLResponsePtr response) { | 67 mojo::URLResponsePtr response) { |
68 ViewProviderApp* app = LoadContent(content_handler_url, response.Pass()); | 68 ViewProviderApp* app = LoadContent(content_handler_url, response.Pass()); |
69 if (app) | 69 if (app) |
70 new mojo::ApplicationImpl(app, application_request.Pass()); | 70 new mojo::ApplicationImpl(app, application_request.Pass()); |
71 } | 71 } |
72 | 72 |
73 } // namespace ui | 73 } // namespace ui |
74 } // namespace mojo | 74 } // namespace mojo |
OLD | NEW |