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

Unified Diff: mojo/examples/embedded_app/embedded_app.cc

Issue 303163005: Embedding demo in View manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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
Index: mojo/examples/embedded_app/embedded_app.cc
diff --git a/mojo/examples/embedded_app/embedded_app.cc b/mojo/examples/embedded_app/embedded_app.cc
new file mode 100644
index 0000000000000000000000000000000000000000..139e313d3c07fe131d50c29b30fef904c61fdc39
--- /dev/null
+++ b/mojo/examples/embedded_app/embedded_app.cc
@@ -0,0 +1,40 @@
+// Copyright 2014 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.
+
+#include "base/basictypes.h"
+#include "mojo/public/cpp/application/application.h"
+#include "mojo/services/public/cpp/view_manager/view.h"
+#include "mojo/services/public/cpp/view_manager/view_manager.h"
+#include "mojo/services/public/cpp/view_manager/view_tree_node.h"
+
+namespace mojo {
+namespace examples {
+
+class EmbeddedApp : public Application {
+ public:
+ EmbeddedApp() {}
+ virtual ~EmbeddedApp() {}
+
+ private:
+ // Overridden from Application:
+ virtual void Initialize() MOJO_OVERRIDE {
+ view_manager_ = new view_manager::ViewManager(this);
+ view_manager::View* view = view_manager::View::Create(view_manager_);
+ view_manager_->tree()->SetActiveView(view);
+ view->SetColor(SK_ColorYELLOW);
+ }
+
+ view_manager::ViewManager* view_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(EmbeddedApp);
+};
+
+} // namespace examples
+
+// static
+Application* Application::Create() {
+ return new examples::EmbeddedApp;
+}
+
+} // namespace mojo
« no previous file with comments | « mojo/examples/demo_launcher/demo_launcher.cc ('k') | mojo/examples/sample_view_manager_app/sample_view_manager_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698