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/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "chrome/browser/browser_util_win.h" | 47 #include "chrome/browser/browser_util_win.h" |
48 #include "chrome/browser/first_run/upgrade_util_win.h" | 48 #include "chrome/browser/first_run/upgrade_util_win.h" |
49 #include "chrome/browser/rlz/rlz.h" | 49 #include "chrome/browser/rlz/rlz.h" |
50 #endif | 50 #endif |
51 | 51 |
52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
53 #include "chrome/browser/chromeos/boot_times_loader.h" | 53 #include "chrome/browser/chromeos/boot_times_loader.h" |
54 #include "chrome/browser/chromeos/cros/cros_library.h" | 54 #include "chrome/browser/chromeos/cros/cros_library.h" |
55 #include "chrome/browser/chromeos/cros/login_library.h" | 55 #include "chrome/browser/chromeos/cros/login_library.h" |
56 #include "chrome/browser/chromeos/system_key_event_listener.h" | 56 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 57 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
57 #endif | 58 #endif |
58 | 59 |
59 using base::Time; | 60 using base::Time; |
60 using base::TimeDelta; | 61 using base::TimeDelta; |
61 | 62 |
62 namespace browser_shutdown { | 63 namespace browser_shutdown { |
63 | 64 |
64 // Whether the browser is trying to quit (e.g., Quit chosen from menu). | 65 // Whether the browser is trying to quit (e.g., Quit chosen from menu). |
65 bool g_trying_to_quit = false; | 66 bool g_trying_to_quit = false; |
66 | 67 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // shutdown. | 125 // shutdown. |
125 base::ThreadRestrictions::SetIOAllowed(true); | 126 base::ThreadRestrictions::SetIOAllowed(true); |
126 | 127 |
127 // Shutdown the IPC channel to the service processes. | 128 // Shutdown the IPC channel to the service processes. |
128 ServiceProcessControl::GetInstance()->Disconnect(); | 129 ServiceProcessControl::GetInstance()->Disconnect(); |
129 | 130 |
130 #if defined(OS_CHROMEOS) | 131 #if defined(OS_CHROMEOS) |
131 // The system key event listener needs to be shut down earlier than when | 132 // The system key event listener needs to be shut down earlier than when |
132 // Singletons are finally destroyed in AtExitManager. | 133 // Singletons are finally destroyed in AtExitManager. |
133 chromeos::SystemKeyEventListener::GetInstance()->Stop(); | 134 chromeos::SystemKeyEventListener::GetInstance()->Stop(); |
| 135 |
| 136 // TODO(yusukes): Remove the #if once the ARM bot (crbug.com/84694) is fixed. |
| 137 #if defined(HAVE_XINPUT2) |
| 138 // The XInput2 event listener needs to be shut down earlier than when |
| 139 // Singletons are finally destroyed in AtExitManager. |
| 140 chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 141 #endif |
134 #endif | 142 #endif |
135 | 143 |
136 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 144 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
137 // time to get here. If you have something that *must* happen on end session, | 145 // time to get here. If you have something that *must* happen on end session, |
138 // consider putting it in BrowserProcessImpl::EndSession. | 146 // consider putting it in BrowserProcessImpl::EndSession. |
139 DCHECK(g_browser_process); | 147 DCHECK(g_browser_process); |
140 | 148 |
141 // Notifies we are going away. | 149 // Notifies we are going away. |
142 g_browser_process->shutdown_event()->Signal(); | 150 g_browser_process->shutdown_event()->Signal(); |
143 | 151 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 343 |
336 bool ShuttingDownWithoutClosingBrowsers() { | 344 bool ShuttingDownWithoutClosingBrowsers() { |
337 #if defined(USE_X11) | 345 #if defined(USE_X11) |
338 if (GetShutdownType() == browser_shutdown::END_SESSION) | 346 if (GetShutdownType() == browser_shutdown::END_SESSION) |
339 return true; | 347 return true; |
340 #endif | 348 #endif |
341 return false; | 349 return false; |
342 } | 350 } |
343 | 351 |
344 } // namespace browser_shutdown | 352 } // namespace browser_shutdown |
OLD | NEW |