summaryrefslogtreecommitdiffstats
path: root/mojo/examples/aura_demo
diff options
context:
space:
mode:
Diffstat (limited to 'mojo/examples/aura_demo')
-rw-r--r--mojo/examples/aura_demo/aura_demo.cc15
-rw-r--r--mojo/examples/aura_demo/view_manager_init.cc11
2 files changed, 16 insertions, 10 deletions
diff --git a/mojo/examples/aura_demo/aura_demo.cc b/mojo/examples/aura_demo/aura_demo.cc
index de005a7..4f88dfb 100644
--- a/mojo/examples/aura_demo/aura_demo.cc
+++ b/mojo/examples/aura_demo/aura_demo.cc
@@ -10,7 +10,7 @@
#include "mojo/aura/screen_mojo.h"
#include "mojo/aura/window_tree_host_mojo.h"
#include "mojo/aura/window_tree_host_mojo_delegate.h"
-#include "mojo/public/cpp/application/application.h"
+#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
#include "mojo/services/public/cpp/view_manager/node.h"
@@ -103,7 +103,7 @@ class DemoWindowTreeClient : public aura::client::WindowTreeClient {
DISALLOW_COPY_AND_ASSIGN(DemoWindowTreeClient);
};
-class AuraDemo : public Application,
+class AuraDemo : public ApplicationDelegate,
public WindowTreeHostMojoDelegate,
public view_manager::ViewManagerDelegate {
public:
@@ -112,7 +112,6 @@ class AuraDemo : public Application,
window2_(NULL),
window21_(NULL),
view_(NULL) {
- view_manager::ViewManager::Create(this, this);
}
virtual ~AuraDemo() {}
@@ -159,7 +158,7 @@ class AuraDemo : public Application,
view_->SetContents(bitmap);
}
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE {
aura::Env::CreateInstance(true);
context_factory_.reset(new ContextFactoryMojo);
aura::Env::GetInstance()->set_context_factory(context_factory_.get());
@@ -167,6 +166,12 @@ class AuraDemo : public Application,
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
}
+ virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
+ MOJO_OVERRIDE {
+ view_manager::ViewManager::ConfigureIncomingConnection(connection, this);
+ return true;
+ }
+
scoped_ptr<DemoWindowTreeClient> window_tree_client_;
scoped_ptr<ui::ContextFactory> context_factory_;
@@ -191,7 +196,7 @@ class AuraDemo : public Application,
} // namespace examples
// static
-Application* Application::Create() {
+ApplicationDelegate* ApplicationDelegate::Create() {
return new examples::AuraDemo();
}
diff --git a/mojo/examples/aura_demo/view_manager_init.cc b/mojo/examples/aura_demo/view_manager_init.cc
index 7a558d3..4130193 100644
--- a/mojo/examples/aura_demo/view_manager_init.cc
+++ b/mojo/examples/aura_demo/view_manager_init.cc
@@ -4,7 +4,8 @@
#include "base/basictypes.h"
#include "base/bind.h"
-#include "mojo/public/cpp/application/application.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
namespace mojo {
@@ -12,13 +13,13 @@ namespace examples {
// ViewManagerInit is responsible for establishing the initial connection to
// the view manager. When established it loads |mojo_aura_demo|.
-class ViewManagerInit : public Application {
+class ViewManagerInit : public ApplicationDelegate {
public:
ViewManagerInit() {}
virtual ~ViewManagerInit() {}
- virtual void Initialize() OVERRIDE {
- ConnectTo("mojo:mojo_view_manager", &view_manager_init_);
+ virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE {
+ app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_);
view_manager_init_->EmbedRoot("mojo:mojo_aura_demo",
base::Bind(&ViewManagerInit::DidConnect,
base::Unretained(this)));
@@ -38,7 +39,7 @@ class ViewManagerInit : public Application {
} // namespace examples
// static
-Application* Application::Create() {
+ApplicationDelegate* ApplicationDelegate::Create() {
return new examples::ViewManagerInit();
}