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

Unified Diff: sky/viewer/sky_viewer_base.h

Issue 1083273003: Expose some sky_viewer plumbing to allow for reuse (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « sky/viewer/sky_loader.cc ('k') | sky/viewer/sky_viewer_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/sky_viewer_base.h
diff --git a/sky/viewer/sky_viewer_base.h b/sky/viewer/sky_viewer_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..d4d27a87d31c498303d4036d1394176e959fcaaa
--- /dev/null
+++ b/sky/viewer/sky_viewer_base.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SKY_VIEWER_SKY_VIEWER_BASE_H_
+#define SKY_VIEWER_SKY_VIEWER_BASE_H_
+
+#include "mojo/common/tracing_impl.h"
+#include "mojo/icu/icu.h"
+#include "mojo/public/cpp/application/application_connection.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/application/interface_factory_impl.h"
+#include "mojo/services/content_handler/public/interfaces/content_handler.mojom.h"
+#include "sky/services/platform/platform_impl.h"
+
+namespace sky {
+
+// An abstract class that handles most of the details of setting up an
+// application that is intended to run Sky content. Subclasses must implement
+// the mojo::InterfaceFactory<mojo::ContentHandler>::Create() method to
+// specialize this class with the concrete content handler that they are using.
+class SkyViewerBase : public mojo::ApplicationDelegate,
+ public mojo::InterfaceFactory<mojo::ContentHandler> {
+ public:
+ SkyViewerBase();
+
+ ~SkyViewerBase() override;
+
+ private:
+ // Overridden from ApplicationDelegate:
+ void Initialize(mojo::ApplicationImpl* app) override;
+
+ bool ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) override;
+
+ scoped_ptr<PlatformImpl> platform_impl_;
+ mojo::TracingImpl tracing_;
+
+ DISALLOW_COPY_AND_ASSIGN(SkyViewerBase);
+};
+
+} // namespace sky
+
+#endif // SKY_VIEWER_SKY_VIEWER_BASE_H_
« no previous file with comments | « sky/viewer/sky_loader.cc ('k') | sky/viewer/sky_viewer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698