| Index: mojo/package_manager/content_handler_connection.h
|
| diff --git a/mojo/shell/content_handler_connection.h b/mojo/package_manager/content_handler_connection.h
|
| similarity index 62%
|
| rename from mojo/shell/content_handler_connection.h
|
| rename to mojo/package_manager/content_handler_connection.h
|
| index b71422f44b7897dc4b4680aca0fec2a47d2fff25..9bc107970ab905c0e10ac41c470792a28b714b21 100644
|
| --- a/mojo/shell/content_handler_connection.h
|
| +++ b/mojo/package_manager/content_handler_connection.h
|
| @@ -2,20 +2,21 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef MOJO_SHELL_CONTENT_HANDLER_CONNECTION_H_
|
| -#define MOJO_SHELL_CONTENT_HANDLER_CONNECTION_H_
|
| +#ifndef MOJO_PACKAGE_MANAGER_CONTENT_HANDLER_CONNECTION_H_
|
| +#define MOJO_PACKAGE_MANAGER_CONTENT_HANDLER_CONNECTION_H_
|
|
|
| #include <string>
|
|
|
| +#include "base/callback.h"
|
| #include "mojo/application/public/interfaces/content_handler.mojom.h"
|
| #include "mojo/shell/identity.h"
|
| #include "url/gurl.h"
|
|
|
| namespace mojo {
|
| namespace shell {
|
| -
|
| class ApplicationManager;
|
| -class Identity;
|
| +}
|
| +namespace package_manager {
|
|
|
| // A ContentHandlerConnection is responsible for creating and maintaining a
|
| // connection to an app which provides the ContentHandler service.
|
| @@ -25,24 +26,27 @@ class Identity;
|
| // destruction.
|
| class ContentHandlerConnection {
|
| public:
|
| + using ClosedCallback = base::Callback<void(ContentHandlerConnection*)>;
|
| // |id| is a unique identifier for this content handler.
|
| - ContentHandlerConnection(ApplicationManager* manager,
|
| - const Identity& source,
|
| - const Identity& content_handler,
|
| - uint32_t id);
|
| + ContentHandlerConnection(shell::ApplicationManager* manager,
|
| + const shell::Identity& source,
|
| + const shell::Identity& content_handler,
|
| + uint32_t id,
|
| + const ClosedCallback& connection_closed_callback);
|
|
|
| // Closes the connection and destroys |this| object.
|
| void CloseConnection();
|
|
|
| ContentHandler* content_handler() { return content_handler_.get(); }
|
| - const Identity& identity() const { return identity_; }
|
| + const shell::Identity& identity() const { return identity_; }
|
| uint32_t id() const { return id_; }
|
|
|
| private:
|
| ~ContentHandlerConnection();
|
|
|
| - ApplicationManager* manager_;
|
| - Identity identity_;
|
| + ClosedCallback connection_closed_callback_;
|
| + shell::Identity identity_;
|
| +
|
| ContentHandlerPtr content_handler_;
|
| bool connection_closed_;
|
| // The id for this content handler.
|
| @@ -51,7 +55,7 @@ class ContentHandlerConnection {
|
| DISALLOW_COPY_AND_ASSIGN(ContentHandlerConnection);
|
| };
|
|
|
| -} // namespace shell
|
| +} // namespace package_manager
|
| } // namespace mojo
|
|
|
| -#endif // MOJO_SHELL_CONTENT_HANDLER_CONNECTION_H_
|
| +#endif // MOJO_PACKAGE_MANAGER_CONTENT_HANDLER_CONNECTION_H_
|
|
|