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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 private: | 107 private: |
108 // ApplicationLoader implementation. | 108 // ApplicationLoader implementation. |
109 void Load(const GURL& url, | 109 void Load(const GURL& url, |
110 InterfaceRequest<mojom::ShellClient> request) override { | 110 InterfaceRequest<mojom::ShellClient> request) override { |
111 ++num_loads_; | 111 ++num_loads_; |
112 shell_connection_.reset(new ShellConnection(this, std::move(request))); | 112 shell_connection_.reset(new ShellConnection(this, std::move(request))); |
113 } | 113 } |
114 | 114 |
115 // mojo::ShellClient implementation. | 115 // mojo::ShellClient implementation. |
116 bool AcceptConnection(Connection* connection) override { | 116 bool AcceptConnection(Connection* connection) override { |
117 connection->AddService<mojom::ContentHandler>(this); | 117 connection->AddInterface<mojom::ContentHandler>(this); |
118 last_requestor_url_ = GURL(connection->GetRemoteApplicationURL()); | 118 last_requestor_url_ = GURL(connection->GetRemoteApplicationURL()); |
119 return true; | 119 return true; |
120 } | 120 } |
121 // InterfaceFactory<mojom::ContentHandler> implementation. | 121 // InterfaceFactory<mojom::ContentHandler> implementation. |
122 void Create(Connection* connection, | 122 void Create(Connection* connection, |
123 InterfaceRequest<mojom::ContentHandler> request) override { | 123 InterfaceRequest<mojom::ContentHandler> request) override { |
124 new TestContentHandler(connection, std::move(request)); | 124 new TestContentHandler(connection, std::move(request)); |
125 } | 125 } |
126 | 126 |
127 scoped_ptr<ShellConnection> shell_connection_; | 127 scoped_ptr<ShellConnection> shell_connection_; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 params->SetTargetURL(GURL("test:test")); | 319 params->SetTargetURL(GURL("test:test")); |
320 params->set_connect_callback( | 320 params->set_connect_callback( |
321 [&content_handler_id](uint32_t, uint32_t t) { content_handler_id = t; }); | 321 [&content_handler_id](uint32_t, uint32_t t) { content_handler_id = t; }); |
322 application_manager_->ConnectToApplication(std::move(params)); | 322 application_manager_->ConnectToApplication(std::move(params)); |
323 EXPECT_EQ(0u, content_handler_id); | 323 EXPECT_EQ(0u, content_handler_id); |
324 } | 324 } |
325 | 325 |
326 } // namespace test | 326 } // namespace test |
327 } // namespace package_manager | 327 } // namespace package_manager |
328 } // namespace mojo | 328 } // namespace mojo |
OLD | NEW |