OLD | NEW |
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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 static base::LazyInstance<MessageLoopObserver> g_message_loop_observer = | 82 static base::LazyInstance<MessageLoopObserver> g_message_loop_observer = |
83 LAZY_INSTANCE_INITIALIZER; | 83 LAZY_INSTANCE_INITIALIZER; |
84 | 84 |
85 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( | 85 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( |
86 const content::MainFunctionParams& parameters) | 86 const content::MainFunctionParams& parameters) |
87 : ChromeBrowserMainPartsLinux(parameters) { | 87 : ChromeBrowserMainPartsLinux(parameters) { |
88 } | 88 } |
89 | 89 |
90 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { | 90 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { |
91 chromeos::accessibility::SystemEventObserver::Shutdown(); | |
92 | |
93 chromeos::disks::DiskMountManager::Shutdown(); | 91 chromeos::disks::DiskMountManager::Shutdown(); |
94 | 92 |
95 chromeos::BluetoothManager::Shutdown(); | |
96 | |
97 chromeos::DBusThreadManager::Shutdown(); | 93 chromeos::DBusThreadManager::Shutdown(); |
98 | 94 |
99 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) | 95 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) |
100 chromeos::CrosLibrary::Shutdown(); | 96 chromeos::CrosLibrary::Shutdown(); |
101 | 97 |
102 // To be precise, logout (browser shutdown) is not yet done, but the | 98 // To be precise, logout (browser shutdown) is not yet done, but the |
103 // remaining work is negligible, hence we say LogoutDone here. | 99 // remaining work is negligible, hence we say LogoutDone here. |
104 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 100 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
105 false); | 101 false); |
106 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 102 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // We should remove observers attached to D-Bus clients before | 211 // We should remove observers attached to D-Bus clients before |
216 // DBusThreadManager is shut down. | 212 // DBusThreadManager is shut down. |
217 if (session_manager_observer_.get()) { | 213 if (session_manager_observer_.get()) { |
218 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 214 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
219 RemoveObserver(session_manager_observer_.get()); | 215 RemoveObserver(session_manager_observer_.get()); |
220 } | 216 } |
221 if (brightness_observer_.get()) { | 217 if (brightness_observer_.get()) { |
222 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() | 218 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() |
223 ->RemoveObserver(brightness_observer_.get()); | 219 ->RemoveObserver(brightness_observer_.get()); |
224 } | 220 } |
| 221 |
| 222 // Shut these down here instead of in the destructor in case we exited before |
| 223 // running BrowserMainLoop::RunMainMessageLoopParts() and never initialized |
| 224 // these. |
| 225 chromeos::accessibility::SystemEventObserver::Shutdown(); |
| 226 chromeos::BluetoothManager::Shutdown(); |
225 } | 227 } |
OLD | NEW |