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

Unified Diff: mojo/ui/content_viewer_app.h

Issue 2020453003: Convert ViewProviderApp and ContentViewerApp to implement ApplicationImplBase instead of Applicatio… (Closed) Base URL: https://github.com/domokit/mojo.git@work796_no_run_main_app
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/ui/tile/tile_app.cc ('k') | mojo/ui/content_viewer_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « examples/ui/tile/tile_app.cc ('k') | mojo/ui/content_viewer_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698