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

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

Issue 9535025: Remove the singleton instance get/delete methods from RootWindow (yay) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | « content/browser/renderer_host/test_render_view_host.cc ('k') | ui/aura/root_window.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::InitSharedInstanceWithLocale("en-US"); 85 ResourceBundle::InitSharedInstanceWithLocale("en-US");
86 86
87 // Create the message-loop here before creating the root window. 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::RootWindow::GetInstance(); 91 scoped_ptr<aura::RootWindow> root_window(new aura::RootWindow);
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_TEXTURED); 97 window1.Init(ui::Layer::LAYER_TEXTURED);
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_TEXTURED); 105 window2.Init(ui::Layer::LAYER_TEXTURED);
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_TEXTURED); 113 window3.Init(ui::Layer::LAYER_TEXTURED);
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::RootWindow::GetInstance()->ShowRootWindow(); 118 root_window->ShowRootWindow();
119 MessageLoopForUI::current()->Run(); 119 MessageLoopForUI::current()->Run();
120 120
121 ui::CompositorTestSupport::Terminate(); 121 ui::CompositorTestSupport::Terminate();
122 122
123 return 0; 123 return 0;
124 } 124 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/test_render_view_host.cc ('k') | ui/aura/root_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698