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

Side by Side Diff: views/aura_desktop/aura_desktop_main.cc

Issue 7972023: Implicit animations through Layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More tweaks Created 9 years, 2 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
« no previous file with comments | « ui/gfx/compositor/layer_animator_delegate.h ('k') | views/desktop/desktop_window_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/i18n/icu_util.h" 7 #include "base/i18n/icu_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "third_party/skia/include/core/SkXfermode.h" 10 #include "third_party/skia/include/core/SkXfermode.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // Create the message-loop here before creating the desktop. 138 // Create the message-loop here before creating the desktop.
139 MessageLoop message_loop(MessageLoop::TYPE_UI); 139 MessageLoop message_loop(MessageLoop::TYPE_UI);
140 140
141 aura::Desktop::GetInstance(); 141 aura::Desktop::GetInstance();
142 142
143 // Create a hierarchy of test windows. 143 // Create a hierarchy of test windows.
144 DemoWindowDelegate window_delegate1(SK_ColorBLUE); 144 DemoWindowDelegate window_delegate1(SK_ColorBLUE);
145 aura::Window* window1 = new aura::Window(&window_delegate1); 145 aura::Window* window1 = new aura::Window(&window_delegate1);
146 window1->set_id(1); 146 window1->set_id(1);
147 window1->Init(); 147 window1->Init();
148 window1->SetBounds(gfx::Rect(100, 100, 400, 400), 0); 148 window1->SetBounds(gfx::Rect(100, 100, 400, 400));
149 window1->SetVisibility(aura::Window::VISIBILITY_SHOWN); 149 window1->SetVisibility(aura::Window::VISIBILITY_SHOWN);
150 window1->SetParent(NULL); 150 window1->SetParent(NULL);
151 151
152 DemoWindowDelegate window_delegate2(SK_ColorRED); 152 DemoWindowDelegate window_delegate2(SK_ColorRED);
153 aura::Window* window2 = new aura::Window(&window_delegate2); 153 aura::Window* window2 = new aura::Window(&window_delegate2);
154 window2->set_id(2); 154 window2->set_id(2);
155 window2->Init(); 155 window2->Init();
156 window2->SetBounds(gfx::Rect(200, 200, 350, 350), 0); 156 window2->SetBounds(gfx::Rect(200, 200, 350, 350));
157 window2->SetVisibility(aura::Window::VISIBILITY_SHOWN); 157 window2->SetVisibility(aura::Window::VISIBILITY_SHOWN);
158 window2->SetParent(NULL); 158 window2->SetParent(NULL);
159 159
160 DemoWindowDelegate window_delegate3(SK_ColorGREEN); 160 DemoWindowDelegate window_delegate3(SK_ColorGREEN);
161 aura::Window* window3 = new aura::Window(&window_delegate3); 161 aura::Window* window3 = new aura::Window(&window_delegate3);
162 window3->set_id(3); 162 window3->set_id(3);
163 window3->Init(); 163 window3->Init();
164 window3->SetBounds(gfx::Rect(10, 10, 50, 50), 0); 164 window3->SetBounds(gfx::Rect(10, 10, 50, 50));
165 window3->SetVisibility(aura::Window::VISIBILITY_SHOWN); 165 window3->SetVisibility(aura::Window::VISIBILITY_SHOWN);
166 window3->SetParent(window2); 166 window3->SetParent(window2);
167 167
168 views::Widget* widget = new views::Widget; 168 views::Widget* widget = new views::Widget;
169 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 169 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
170 params.bounds = gfx::Rect(75, 75, 80, 80); 170 params.bounds = gfx::Rect(75, 75, 80, 80);
171 params.parent = window2; 171 params.parent = window2;
172 widget->Init(params); 172 widget->Init(params);
173 widget->SetContentsView(new TestView); 173 widget->SetContentsView(new TestView);
174 174
175 TestWindowContents* contents = new TestWindowContents; 175 TestWindowContents* contents = new TestWindowContents;
176 views::Widget* views_window = views::Widget::CreateWindowWithParentAndBounds( 176 views::Widget* views_window = views::Widget::CreateWindowWithParentAndBounds(
177 contents, window2, gfx::Rect(120, 150, 200, 200)); 177 contents, window2, gfx::Rect(120, 150, 200, 200));
178 views_window->Show(); 178 views_window->Show();
179 179
180 aura::Desktop::GetInstance()->Run(); 180 aura::Desktop::GetInstance()->Run();
181 181
182 delete aura::Desktop::GetInstance(); 182 delete aura::Desktop::GetInstance();
183 183
184 return 0; 184 return 0;
185 } 185 }
186 186
OLDNEW
« no previous file with comments | « ui/gfx/compositor/layer_animator_delegate.h ('k') | views/desktop/desktop_window_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698