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

Unified Diff: examples/ui/spinning_cube/spinning_cube_app.h

Issue 1411103004: mozart: Port the spinning cube example. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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/spinning_cube/main.cc ('k') | examples/ui/spinning_cube/spinning_cube_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/ui/spinning_cube/spinning_cube_app.h
diff --git a/examples/ui/spinning_cube/spinning_cube_app.h b/examples/ui/spinning_cube/spinning_cube_app.h
new file mode 100644
index 0000000000000000000000000000000000000000..d1e99e7c58a31655bda705a2b361c4549ff26f6c
--- /dev/null
+++ b/examples/ui/spinning_cube/spinning_cube_app.h
@@ -0,0 +1,50 @@
+// 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 EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_APP_H_
+#define EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_APP_H_
+
+#include "base/bind.h"
+#include "base/memory/scoped_ptr.h"
+#include "mojo/common/binding_set.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/application/application_connection.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/system/core.h"
+#include "mojo/public/cpp/system/macros.h"
+#include "mojo/services/ui/views/interfaces/view_provider.mojom.h"
+
+namespace examples {
+
+class SpinningCubeApp : public mojo::ApplicationDelegate,
+ public mojo::InterfaceFactory<mojo::ui::ViewProvider>,
+ public mojo::ui::ViewProvider {
+ public:
+ SpinningCubeApp();
+ ~SpinningCubeApp() override;
+
+ private:
+ // |ApplicationDelegate|:
+ void Initialize(mojo::ApplicationImpl* app) override;
+ bool ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) override;
+
+ // |InterfaceFactory<mojo::ui::ViewProvider>|:
+ void Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojo::ui::ViewProvider> request) override;
+
+ // |ViewProvider|:
+ void CreateView(mojo::InterfaceRequest<mojo::ServiceProvider> services,
+ mojo::ServiceProviderPtr exposed_services,
+ const CreateViewCallback& callback) override;
+
+ mojo::ApplicationImpl* app_impl_;
+ mojo::BindingSet<mojo::ui::ViewProvider> bindings_;
+
+ DISALLOW_COPY_AND_ASSIGN(SpinningCubeApp);
+};
+
+} // namespace examples
+
+#endif // EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_APP_H_
« no previous file with comments | « examples/ui/spinning_cube/main.cc ('k') | examples/ui/spinning_cube/spinning_cube_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698