| 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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "mojo/common/bindings_support_impl.h" | 9 #include "mojo/common/bindings_support_impl.h" |
| 10 #include "mojo/examples/aura_demo/demo_screen.h" | 10 #include "mojo/examples/aura_demo/demo_screen.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 aura::RootWindow::CreateParams params(gfx::Rect(0, 0, 500, 500)); | 141 aura::RootWindow::CreateParams params(gfx::Rect(0, 0, 500, 500)); |
| 142 params.host = root_window_host_.get(); | 142 params.host = root_window_host_.get(); |
| 143 root_window_.reset(new aura::RootWindow(params)); | 143 root_window_.reset(new aura::RootWindow(params)); |
| 144 root_window_host_->set_delegate(root_window_.get()); | 144 root_window_host_->set_delegate(root_window_.get()); |
| 145 root_window_->Init(); | 145 root_window_->Init(); |
| 146 | 146 |
| 147 window_tree_client_.reset(new DemoWindowTreeClient(root_window_->window())); | 147 window_tree_client_.reset(new DemoWindowTreeClient(root_window_->window())); |
| 148 | 148 |
| 149 delegate1_.reset(new DemoWindowDelegate(SK_ColorBLUE)); | 149 delegate1_.reset(new DemoWindowDelegate(SK_ColorBLUE)); |
| 150 window1_ = new aura::Window(delegate1_.get()); | 150 window1_ = new aura::Window(delegate1_.get()); |
| 151 window1_->Init(ui::LAYER_TEXTURED); | 151 window1_->Init(aura::WINDOW_LAYER_TEXTURED); |
| 152 window1_->SetBounds(gfx::Rect(100, 100, 400, 400)); | 152 window1_->SetBounds(gfx::Rect(100, 100, 400, 400)); |
| 153 window1_->Show(); | 153 window1_->Show(); |
| 154 root_window_->window()->AddChild(window1_); | 154 root_window_->window()->AddChild(window1_); |
| 155 | 155 |
| 156 delegate2_.reset(new DemoWindowDelegate(SK_ColorRED)); | 156 delegate2_.reset(new DemoWindowDelegate(SK_ColorRED)); |
| 157 window2_ = new aura::Window(delegate2_.get()); | 157 window2_ = new aura::Window(delegate2_.get()); |
| 158 window2_->Init(ui::LAYER_TEXTURED); | 158 window2_->Init(aura::WINDOW_LAYER_TEXTURED); |
| 159 window2_->SetBounds(gfx::Rect(200, 200, 350, 350)); | 159 window2_->SetBounds(gfx::Rect(200, 200, 350, 350)); |
| 160 window2_->Show(); | 160 window2_->Show(); |
| 161 root_window_->window()->AddChild(window2_); | 161 root_window_->window()->AddChild(window2_); |
| 162 | 162 |
| 163 delegate21_.reset(new DemoWindowDelegate(SK_ColorGREEN)); | 163 delegate21_.reset(new DemoWindowDelegate(SK_ColorGREEN)); |
| 164 window21_ = new aura::Window(delegate21_.get()); | 164 window21_ = new aura::Window(delegate21_.get()); |
| 165 window21_->Init(ui::LAYER_TEXTURED); | 165 window21_->Init(aura::WINDOW_LAYER_TEXTURED); |
| 166 window21_->SetBounds(gfx::Rect(10, 10, 50, 50)); | 166 window21_->SetBounds(gfx::Rect(10, 10, 50, 50)); |
| 167 window21_->Show(); | 167 window21_->Show(); |
| 168 window2_->AddChild(window21_); | 168 window2_->AddChild(window21_); |
| 169 | 169 |
| 170 root_window_->host()->Show(); | 170 root_window_->host()->Show(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 scoped_ptr<DemoScreen> screen_; | 173 scoped_ptr<DemoScreen> screen_; |
| 174 | 174 |
| 175 scoped_ptr<DemoWindowTreeClient> window_tree_client_; | 175 scoped_ptr<DemoWindowTreeClient> window_tree_client_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 202 // Aura that doesn't define platform-specific stuff. | 202 // Aura that doesn't define platform-specific stuff. |
| 203 aura::Env::CreateInstance(); | 203 aura::Env::CreateInstance(); |
| 204 mojo::examples::AuraDemo app( | 204 mojo::examples::AuraDemo app( |
| 205 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); | 205 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); |
| 206 loop.Run(); | 206 loop.Run(); |
| 207 | 207 |
| 208 MojoGLES2Terminate(); | 208 MojoGLES2Terminate(); |
| 209 mojo::BindingsSupport::Set(NULL); | 209 mojo::BindingsSupport::Set(NULL); |
| 210 return MOJO_RESULT_OK; | 210 return MOJO_RESULT_OK; |
| 211 } | 211 } |
| OLD | NEW |