OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "mojo/application/application_runner_chromium.h" | 10 #include "mojo/application/application_runner_chromium.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 class AuraDemo : public mojo::ApplicationDelegate, | 107 class AuraDemo : public mojo::ApplicationDelegate, |
108 public mojo::ViewManagerDelegate { | 108 public mojo::ViewManagerDelegate { |
109 public: | 109 public: |
110 AuraDemo() | 110 AuraDemo() |
111 : shell_(nullptr), window1_(NULL), window2_(NULL), window21_(NULL) {} | 111 : shell_(nullptr), window1_(NULL), window2_(NULL), window21_(NULL) {} |
112 virtual ~AuraDemo() {} | 112 virtual ~AuraDemo() {} |
113 | 113 |
114 private: | 114 private: |
115 // Overridden from ViewManagerDelegate: | 115 // Overridden from ViewManagerDelegate: |
116 virtual void OnEmbed( | 116 virtual void OnEmbed( |
117 mojo::ViewManager* view_manager, | |
118 mojo::View* root, | 117 mojo::View* root, |
119 mojo::ServiceProviderImpl* exported_services, | 118 mojo::ServiceProviderImpl* exported_services, |
120 scoped_ptr<mojo::ServiceProvider> imported_services) override { | 119 scoped_ptr<mojo::ServiceProvider> imported_services) override { |
121 // TODO(beng): this function could be called multiple times! | 120 // TODO(beng): this function could be called multiple times! |
122 root_ = root; | 121 root_ = root; |
123 | 122 |
124 window_tree_host_.reset(new mojo::WindowTreeHostMojo(shell_, root)); | 123 window_tree_host_.reset(new mojo::WindowTreeHostMojo(shell_, root)); |
125 window_tree_host_->InitHost(); | 124 window_tree_host_->InitHost(); |
126 | 125 |
127 window_tree_client_.reset( | 126 window_tree_client_.reset( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 191 |
193 DISALLOW_COPY_AND_ASSIGN(AuraDemo); | 192 DISALLOW_COPY_AND_ASSIGN(AuraDemo); |
194 }; | 193 }; |
195 | 194 |
196 } // namespace examples | 195 } // namespace examples |
197 | 196 |
198 MojoResult MojoMain(MojoHandle shell_handle) { | 197 MojoResult MojoMain(MojoHandle shell_handle) { |
199 mojo::ApplicationRunnerChromium runner(new examples::AuraDemo); | 198 mojo::ApplicationRunnerChromium runner(new examples::AuraDemo); |
200 return runner.Run(shell_handle); | 199 return runner.Run(shell_handle); |
201 } | 200 } |
OLD | NEW |