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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/basictypes.h"
6 #include "mojo/public/cpp/application/application.h"
7 #include "mojo/services/public/cpp/view_manager/view.h"
8 #include "mojo/services/public/cpp/view_manager/view_manager.h"
9 #include "mojo/services/public/cpp/view_manager/view_tree_node.h"
10
11 namespace mojo {
12 namespace examples {
13
14 class EmbeddedApp : public Application {
15 public:
16 EmbeddedApp() {}
17 virtual ~EmbeddedApp() {}
18
19 private:
20 // Overridden from Application:
21 virtual void Initialize() MOJO_OVERRIDE {
22 view_manager_ = new view_manager::ViewManager(this);
23 view_manager::View* view = view_manager::View::Create(view_manager_);
24 view_manager_->tree()->SetActiveView(view);
25 view->SetColor(SK_ColorYELLOW);
26 }
27
28 view_manager::ViewManager* view_manager_;
29
30 DISALLOW_COPY_AND_ASSIGN(EmbeddedApp);
31 };
32
33 } // namespace examples
34
35 // static
36 Application* Application::Create() {
37 return new examples::EmbeddedApp;
38 }
39
40 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698