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

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

Issue 29883002: Attempt to re-land FocusManager removal from Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test with note. Created 7 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/aura/client/focus_client.h ('k') | ui/aura/focus_manager.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/message_loop.h" 9 #include "base/message_loop/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/client/default_capture_client.h" 11 #include "ui/aura/client/default_capture_client.h"
12 #include "ui/aura/client/stacking_client.h" 12 #include "ui/aura/client/stacking_client.h"
13 #include "ui/aura/env.h" 13 #include "ui/aura/env.h"
14 #include "ui/aura/focus_manager.h"
15 #include "ui/aura/root_window.h" 14 #include "ui/aura/root_window.h"
15 #include "ui/aura/test/test_focus_client.h"
16 #include "ui/aura/test/test_screen.h" 16 #include "ui/aura/test/test_screen.h"
17 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
18 #include "ui/aura/window_delegate.h" 18 #include "ui/aura/window_delegate.h"
19 #include "ui/base/hit_test.h" 19 #include "ui/base/hit_test.h"
20 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/base/ui_base_paths.h" 21 #include "ui/base/ui_base_paths.h"
22 #include "ui/compositor/compositor.h" 22 #include "ui/compositor/compositor.h"
23 #include "ui/events/event.h" 23 #include "ui/events/event.h"
24 #include "ui/gfx/canvas.h" 24 #include "ui/gfx/canvas.h"
25 #include "ui/gfx/rect.h" 25 #include "ui/gfx/rect.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bool allow_test_contexts = false; 115 bool allow_test_contexts = false;
116 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); 116 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts);
117 117
118 aura::Env::CreateInstance(); 118 aura::Env::CreateInstance();
119 scoped_ptr<aura::TestScreen> test_screen(aura::TestScreen::Create()); 119 scoped_ptr<aura::TestScreen> test_screen(aura::TestScreen::Create());
120 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); 120 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get());
121 scoped_ptr<aura::RootWindow> root_window( 121 scoped_ptr<aura::RootWindow> root_window(
122 test_screen->CreateRootWindowForPrimaryDisplay()); 122 test_screen->CreateRootWindowForPrimaryDisplay());
123 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient( 123 scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient(
124 root_window.get())); 124 root_window.get()));
125 aura::FocusManager focus_manager; 125 aura::test::TestFocusClient focus_client;
126 aura::client::SetFocusClient(root_window.get(), &focus_manager); 126 aura::client::SetFocusClient(root_window.get(), &focus_client);
127 127
128 // Create a hierarchy of test windows. 128 // Create a hierarchy of test windows.
129 DemoWindowDelegate window_delegate1(SK_ColorBLUE); 129 DemoWindowDelegate window_delegate1(SK_ColorBLUE);
130 aura::Window window1(&window_delegate1); 130 aura::Window window1(&window_delegate1);
131 window1.set_id(1); 131 window1.set_id(1);
132 window1.Init(ui::LAYER_TEXTURED); 132 window1.Init(ui::LAYER_TEXTURED);
133 window1.SetBounds(gfx::Rect(100, 100, 400, 400)); 133 window1.SetBounds(gfx::Rect(100, 100, 400, 400));
134 window1.Show(); 134 window1.Show();
135 window1.SetDefaultParentByRootWindow(root_window.get(), gfx::Rect()); 135 window1.SetDefaultParentByRootWindow(root_window.get(), gfx::Rect());
136 136
(...skipping 26 matching lines...) Expand all
163 163
164 // The exit manager is in charge of calling the dtors of singleton objects. 164 // The exit manager is in charge of calling the dtors of singleton objects.
165 base::AtExitManager exit_manager; 165 base::AtExitManager exit_manager;
166 166
167 ui::RegisterPathProvider(); 167 ui::RegisterPathProvider();
168 base::i18n::InitializeICU(); 168 base::i18n::InitializeICU();
169 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 169 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
170 170
171 return DemoMain(); 171 return DemoMain();
172 } 172 }
OLDNEW
« no previous file with comments | « ui/aura/client/focus_client.h ('k') | ui/aura/focus_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698