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

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

Issue 910453002: Create PowerMonitor while starting aura_demo and views_examples_exe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | ui/views/examples/examples_main.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) 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 "base/power_monitor/power_monitor.h"
11 #include "base/power_monitor/power_monitor_device_source.h"
10 #include "third_party/skia/include/core/SkXfermode.h" 12 #include "third_party/skia/include/core/SkXfermode.h"
11 #include "ui/aura/client/default_capture_client.h" 13 #include "ui/aura/client/default_capture_client.h"
12 #include "ui/aura/client/window_tree_client.h" 14 #include "ui/aura/client/window_tree_client.h"
13 #include "ui/aura/env.h" 15 #include "ui/aura/env.h"
14 #include "ui/aura/test/test_focus_client.h" 16 #include "ui/aura/test/test_focus_client.h"
15 #include "ui/aura/test/test_screen.h" 17 #include "ui/aura/test/test_screen.h"
16 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
17 #include "ui/aura/window_delegate.h" 19 #include "ui/aura/window_delegate.h"
18 #include "ui/aura/window_tree_host.h" 20 #include "ui/aura/window_tree_host.h"
19 #include "ui/base/hit_test.h" 21 #include "ui/base/hit_test.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 121
120 // The ContextFactory must exist before any Compositors are created. 122 // The ContextFactory must exist before any Compositors are created.
121 bool context_factory_for_test = false; 123 bool context_factory_for_test = false;
122 scoped_ptr<ui::InProcessContextFactory> context_factory( 124 scoped_ptr<ui::InProcessContextFactory> context_factory(
123 new ui::InProcessContextFactory(context_factory_for_test, nullptr)); 125 new ui::InProcessContextFactory(context_factory_for_test, nullptr));
124 context_factory->set_use_test_surface(false); 126 context_factory->set_use_test_surface(false);
125 127
126 // Create the message-loop here before creating the root window. 128 // Create the message-loop here before creating the root window.
127 base::MessageLoopForUI message_loop; 129 base::MessageLoopForUI message_loop;
128 130
131 base::PowerMonitor power_monitor(make_scoped_ptr(
132 new base::PowerMonitorDeviceSource));
133
129 aura::Env::CreateInstance(true); 134 aura::Env::CreateInstance(true);
130 aura::Env::GetInstance()->set_context_factory(context_factory.get()); 135 aura::Env::GetInstance()->set_context_factory(context_factory.get());
131 scoped_ptr<aura::TestScreen> test_screen( 136 scoped_ptr<aura::TestScreen> test_screen(
132 aura::TestScreen::Create(gfx::Size())); 137 aura::TestScreen::Create(gfx::Size()));
133 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); 138 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get());
134 scoped_ptr<aura::WindowTreeHost> host( 139 scoped_ptr<aura::WindowTreeHost> host(
135 test_screen->CreateHostForPrimaryDisplay()); 140 test_screen->CreateHostForPrimaryDisplay());
136 scoped_ptr<DemoWindowTreeClient> window_tree_client( 141 scoped_ptr<DemoWindowTreeClient> window_tree_client(
137 new DemoWindowTreeClient(host->window())); 142 new DemoWindowTreeClient(host->window()));
138 aura::test::TestFocusClient focus_client; 143 aura::test::TestFocusClient focus_client;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 int main(int argc, char** argv) { 179 int main(int argc, char** argv) {
175 base::CommandLine::Init(argc, argv); 180 base::CommandLine::Init(argc, argv);
176 181
177 // The exit manager is in charge of calling the dtors of singleton objects. 182 // The exit manager is in charge of calling the dtors of singleton objects.
178 base::AtExitManager exit_manager; 183 base::AtExitManager exit_manager;
179 184
180 base::i18n::InitializeICU(); 185 base::i18n::InitializeICU();
181 186
182 return DemoMain(); 187 return DemoMain();
183 } 188 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/examples/examples_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698