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

Side by Side Diff: ui/views/examples/examples_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 | « ui/aura/demo/demo_main.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/i18n/icu_util.h" 8 #include "base/i18n/icu_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/power_monitor/power_monitor.h"
12 #include "base/power_monitor/power_monitor_device_source.h"
11 #include "base/run_loop.h" 13 #include "base/run_loop.h"
12 #include "ui/base/ime/input_method_initializer.h" 14 #include "ui/base/ime/input_method_initializer.h"
13 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
14 #include "ui/base/ui_base_paths.h" 16 #include "ui/base/ui_base_paths.h"
15 #include "ui/compositor/test/in_process_context_factory.h" 17 #include "ui/compositor/test/in_process_context_factory.h"
16 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
17 #include "ui/gl/gl_surface.h" 19 #include "ui/gl/gl_surface.h"
18 #include "ui/views/examples/example_base.h" 20 #include "ui/views/examples/example_base.h"
19 #include "ui/views/examples/examples_window.h" 21 #include "ui/views/examples/examples_window.h"
20 #include "ui/views/test/desktop_test_views_delegate.h" 22 #include "ui/views/test/desktop_test_views_delegate.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 base::MessageLoopForUI message_loop; 65 base::MessageLoopForUI message_loop;
64 66
65 base::i18n::InitializeICU(); 67 base::i18n::InitializeICU();
66 68
67 ui::RegisterPathProvider(); 69 ui::RegisterPathProvider();
68 70
69 base::FilePath ui_test_pak_path; 71 base::FilePath ui_test_pak_path;
70 DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); 72 DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
71 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); 73 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
72 74
75 base::PowerMonitor power_monitor(make_scoped_ptr(
76 new base::PowerMonitorDeviceSource));
77
73 #if defined(OS_WIN) 78 #if defined(OS_WIN)
74 gfx::win::MaybeInitializeDirectWrite(); 79 gfx::win::MaybeInitializeDirectWrite();
75 #endif 80 #endif
76 81
77 #if defined(USE_AURA) 82 #if defined(USE_AURA)
78 aura::Env::CreateInstance(true); 83 aura::Env::CreateInstance(true);
79 aura::Env::GetInstance()->set_context_factory(context_factory.get()); 84 aura::Env::GetInstance()->set_context_factory(context_factory.get());
80 #endif 85 #endif
81 ui::InitializeInputMethodForTesting(); 86 ui::InitializeInputMethodForTesting();
82 87
(...skipping 19 matching lines...) Expand all
102 } 107 }
103 108
104 ui::ShutdownInputMethod(); 109 ui::ShutdownInputMethod();
105 110
106 #if defined(USE_AURA) 111 #if defined(USE_AURA)
107 aura::Env::DeleteInstance(); 112 aura::Env::DeleteInstance();
108 #endif 113 #endif
109 114
110 return 0; 115 return 0;
111 } 116 }
OLDNEW
« no previous file with comments | « ui/aura/demo/demo_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698