| Index: mojo/ui/content_viewer_app.h
|
| diff --git a/mojo/ui/content_viewer_app.h b/mojo/ui/content_viewer_app.h
|
| index e09a66afe8fda84ad4a16c495a255e5e38c7e0f7..c28d2d9fec27709dbab3bbf0c56ae0e5a2552fe1 100644
|
| --- a/mojo/ui/content_viewer_app.h
|
| +++ b/mojo/ui/content_viewer_app.h
|
| @@ -6,12 +6,18 @@
|
| #define MOJO_UI_CONTENT_VIEWER_APP_H_
|
|
|
| #include "mojo/common/strong_binding_set.h"
|
| +#include "mojo/public/cpp/application/application_impl_base.h"
|
| +#include "mojo/public/cpp/system/macros.h"
|
| #include "mojo/services/content_handler/interfaces/content_handler.mojom.h"
|
| -#include "mojo/ui/view_provider_app.h"
|
|
|
| namespace mojo {
|
| +
|
| +class ServiceProviderImpl;
|
| +
|
| namespace ui {
|
|
|
| +class ViewProviderApp;
|
| +
|
| // A simple ContentHandler application implementation for rendering
|
| // content as Views. Subclasses must provide a function to create
|
| // the view provider application on demand.
|
| @@ -19,17 +25,14 @@ namespace ui {
|
| // TODO(jeffbrown): Support creating the view provider application in a
|
| // separate thread if desired (often not the case). This is one reason
|
| // we are not using the ContentHandlerFactory here.
|
| -class ContentViewerApp : public ApplicationDelegate {
|
| +class ContentViewerApp : public ApplicationImplBase {
|
| public:
|
| ContentViewerApp();
|
| ~ContentViewerApp() override;
|
|
|
| - ApplicationImpl* app_impl() { return app_impl_; }
|
| -
|
| - // |ApplicationDelegate|:
|
| - void Initialize(ApplicationImpl* app) override;
|
| - bool ConfigureIncomingConnection(
|
| - ServiceProviderImpl* service_provider_impl) override;
|
| + // |ApplicationImplBase|:
|
| + void OnInitialize() override;
|
| + bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override;
|
|
|
| // Called to create the view provider application to view the content.
|
| //
|
| @@ -42,8 +45,12 @@ class ContentViewerApp : public ApplicationDelegate {
|
| // request.
|
| // The |response| carries the data retrieved by the content handler.
|
| //
|
| - // Returns the view provider application delegate to view the content,
|
| - // or nullptr if the content could not be loaded.
|
| + // Returns the view provider application to view the content, or nullptr if
|
| + // the content could not be loaded.
|
| + //
|
| + // TODO(vtl): This interface is a bit broken. (What's the ownership of the
|
| + // returned ViewProviderApp implementation?) See my TODO in the implementation
|
| + // of StartViewer().
|
| virtual ViewProviderApp* LoadContent(const std::string& content_handler_url,
|
| URLResponsePtr response) = 0;
|
|
|
| @@ -54,7 +61,6 @@ class ContentViewerApp : public ApplicationDelegate {
|
| InterfaceRequest<Application> application_request,
|
| URLResponsePtr response);
|
|
|
| - ApplicationImpl* app_impl_ = nullptr;
|
| StrongBindingSet<ContentHandler> bindings_;
|
|
|
| MOJO_DISALLOW_COPY_AND_ASSIGN(ContentViewerApp);
|
|
|