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

Side by Side Diff: ui/aura/demo/demo_main.cc

Issue 8771015: Rename Desktop->RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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/aura/client/aura_constants.cc ('k') | ui/aura/desktop.h » ('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"
11 #include "ui/aura/desktop.h"
12 #include "ui/aura/event.h" 11 #include "ui/aura/event.h"
13 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
14 #include "ui/aura/window_delegate.h" 13 #include "ui/aura/window_delegate.h"
15 #include "ui/base/hit_test.h" 14 #include "ui/base/hit_test.h"
16 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
16 #include "ui/aura/root_window.h"
17 #include "ui/base/ui_base_paths.h" 17 #include "ui/base/ui_base_paths.h"
18 #include "ui/gfx/canvas_skia.h" 18 #include "ui/gfx/canvas_skia.h"
19 #include "ui/gfx/compositor/test/compositor_test_support.h" 19 #include "ui/gfx/compositor/test/compositor_test_support.h"
20 #include "ui/gfx/rect.h" 20 #include "ui/gfx/rect.h"
21 21
22 #if defined(USE_X11) 22 #if defined(USE_X11)
23 #include "base/message_pump_x.h" 23 #include "base/message_pump_x.h"
24 #endif 24 #endif
25 25
26 namespace { 26 namespace {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 int main(int argc, char** argv) { 77 int main(int argc, char** argv) {
78 CommandLine::Init(argc, argv); 78 CommandLine::Init(argc, argv);
79 79
80 // The exit manager is in charge of calling the dtors of singleton objects. 80 // The exit manager is in charge of calling the dtors of singleton objects.
81 base::AtExitManager exit_manager; 81 base::AtExitManager exit_manager;
82 82
83 ui::RegisterPathProvider(); 83 ui::RegisterPathProvider();
84 icu_util::Initialize(); 84 icu_util::Initialize();
85 ResourceBundle::InitSharedInstance("en-US"); 85 ResourceBundle::InitSharedInstance("en-US");
86 86
87 // Create the message-loop here before creating the desktop. 87 // Create the message-loop here before creating the root window.
88 MessageLoop message_loop(MessageLoop::TYPE_UI); 88 MessageLoop message_loop(MessageLoop::TYPE_UI);
89 ui::CompositorTestSupport::Initialize(); 89 ui::CompositorTestSupport::Initialize();
90 90
91 aura::Desktop::GetInstance(); 91 aura::RootWindow::GetInstance();
92 92
93 // Create a hierarchy of test windows. 93 // Create a hierarchy of test windows.
94 DemoWindowDelegate window_delegate1(SK_ColorBLUE); 94 DemoWindowDelegate window_delegate1(SK_ColorBLUE);
95 aura::Window window1(&window_delegate1); 95 aura::Window window1(&window_delegate1);
96 window1.set_id(1); 96 window1.set_id(1);
97 window1.Init(ui::Layer::LAYER_HAS_TEXTURE); 97 window1.Init(ui::Layer::LAYER_HAS_TEXTURE);
98 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); 98 window1.SetBounds(gfx::Rect(100, 100, 400, 400));
99 window1.Show(); 99 window1.Show();
100 window1.SetParent(NULL); 100 window1.SetParent(NULL);
101 101
102 DemoWindowDelegate window_delegate2(SK_ColorRED); 102 DemoWindowDelegate window_delegate2(SK_ColorRED);
103 aura::Window window2(&window_delegate2); 103 aura::Window window2(&window_delegate2);
104 window2.set_id(2); 104 window2.set_id(2);
105 window2.Init(ui::Layer::LAYER_HAS_TEXTURE); 105 window2.Init(ui::Layer::LAYER_HAS_TEXTURE);
106 window2.SetBounds(gfx::Rect(200, 200, 350, 350)); 106 window2.SetBounds(gfx::Rect(200, 200, 350, 350));
107 window2.Show(); 107 window2.Show();
108 window2.SetParent(NULL); 108 window2.SetParent(NULL);
109 109
110 DemoWindowDelegate window_delegate3(SK_ColorGREEN); 110 DemoWindowDelegate window_delegate3(SK_ColorGREEN);
111 aura::Window window3(&window_delegate3); 111 aura::Window window3(&window_delegate3);
112 window3.set_id(3); 112 window3.set_id(3);
113 window3.Init(ui::Layer::LAYER_HAS_TEXTURE); 113 window3.Init(ui::Layer::LAYER_HAS_TEXTURE);
114 window3.SetBounds(gfx::Rect(10, 10, 50, 50)); 114 window3.SetBounds(gfx::Rect(10, 10, 50, 50));
115 window3.Show(); 115 window3.Show();
116 window3.SetParent(&window2); 116 window3.SetParent(&window2);
117 117
118 aura::Desktop::GetInstance()->Run(); 118 aura::RootWindow::GetInstance()->Run();
119 119
120 ui::CompositorTestSupport::Terminate(); 120 ui::CompositorTestSupport::Terminate();
121 121
122 return 0; 122 return 0;
123 } 123 }
OLDNEW
« no previous file with comments | « ui/aura/client/aura_constants.cc ('k') | ui/aura/desktop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698