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

Side by Side Diff: mojo/examples/aura_demo/aura_demo.cc

Issue 372273004: Shutdown cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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
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 "mojo/aura/context_factory_mojo.h" 9 #include "mojo/aura/context_factory_mojo.h"
10 #include "mojo/aura/screen_mojo.h" 10 #include "mojo/aura/screen_mojo.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 delegate21_.reset(new DemoWindowDelegate(SK_ColorGREEN)); 146 delegate21_.reset(new DemoWindowDelegate(SK_ColorGREEN));
147 window21_ = new aura::Window(delegate21_.get()); 147 window21_ = new aura::Window(delegate21_.get());
148 window21_->Init(aura::WINDOW_LAYER_TEXTURED); 148 window21_->Init(aura::WINDOW_LAYER_TEXTURED);
149 window21_->SetBounds(gfx::Rect(10, 10, 50, 50)); 149 window21_->SetBounds(gfx::Rect(10, 10, 50, 50));
150 window21_->Show(); 150 window21_->Show();
151 window2_->AddChild(window21_); 151 window2_->AddChild(window21_);
152 152
153 window_tree_host_->Show(); 153 window_tree_host_->Show();
154 } 154 }
155 virtual void OnViewManagerDisconnected(
156 view_manager::ViewManager* view_manager) OVERRIDE {
157 base::MessageLoop::current()->Quit();
158 }
155 159
156 // WindowTreeHostMojoDelegate: 160 // WindowTreeHostMojoDelegate:
157 virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE { 161 virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE {
158 view_->SetContents(bitmap); 162 view_->SetContents(bitmap);
159 } 163 }
160 164
161 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE { 165 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE {
162 aura::Env::CreateInstance(true); 166 aura::Env::CreateInstance(true);
163 context_factory_.reset(new ContextFactoryMojo); 167 context_factory_.reset(new ContextFactoryMojo);
164 aura::Env::GetInstance()->set_context_factory(context_factory_.get()); 168 aura::Env::GetInstance()->set_context_factory(context_factory_.get());
(...skipping 29 matching lines...) Expand all
194 }; 198 };
195 199
196 } // namespace examples 200 } // namespace examples
197 201
198 // static 202 // static
199 ApplicationDelegate* ApplicationDelegate::Create() { 203 ApplicationDelegate* ApplicationDelegate::Create() {
200 return new examples::AuraDemo(); 204 return new examples::AuraDemo();
201 } 205 }
202 206
203 } // namespace mojo 207 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/examples/browser/browser.cc » ('j') | mojo/services/public/interfaces/native_viewport/native_viewport.mojom » ('J')

Powered by Google App Engine
This is Rietveld 408576698