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/ui/browser_list.h" | 5 #include "chrome/browser/ui/browser_list.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 | 220 |
221 #if defined(OS_CHROMEOS) | 221 #if defined(OS_CHROMEOS) |
222 | 222 |
223 // Whether a session manager requested to shutdown. | 223 // Whether a session manager requested to shutdown. |
224 bool g_session_manager_requested_shutdown = true; | 224 bool g_session_manager_requested_shutdown = true; |
225 | 225 |
226 // Fast shutdown for ChromeOS. It tells session manager to start | 226 // Fast shutdown for ChromeOS. It tells session manager to start |
227 // shutdown process when closing browser windows won't be canceled. | 227 // shutdown process when closing browser windows won't be canceled. |
228 // Returns true if fast shutdown is successfully started. | 228 // Returns true if fast shutdown is successfully started. |
229 bool FastShutdown() { | 229 bool FastShutdown() { |
230 if (chromeos::CrosLibrary::Get()->EnsureLoaded() | 230 if (chromeos::CrosLibrary::Get()->libcros_loaded() |
satorux1
2011/11/16 23:51:34
we don't need to call this, as it's also checked i
stevenjb
2011/11/17 00:23:33
But it does affect the return value, so I didn't w
| |
231 && AreAllBrowsersCloseable()) { | 231 && AreAllBrowsersCloseable()) { |
232 BrowserList::NotifyAndTerminate(true); | 232 BrowserList::NotifyAndTerminate(true); |
233 return true; | 233 return true; |
234 } | 234 } |
235 return false; | 235 return false; |
236 } | 236 } |
237 | 237 |
238 void NotifyWindowManagerAboutSignout() { | 238 void NotifyWindowManagerAboutSignout() { |
239 #if defined(TOOLKIT_USES_GTK) | 239 #if defined(TOOLKIT_USES_GTK) |
240 static bool notified = false; | 240 static bool notified = false; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 return; | 312 return; |
313 notified = true; | 313 notified = true; |
314 #endif | 314 #endif |
315 | 315 |
316 if (fast_path) | 316 if (fast_path) |
317 NotifyAppTerminating(); | 317 NotifyAppTerminating(); |
318 | 318 |
319 #if defined(OS_CHROMEOS) | 319 #if defined(OS_CHROMEOS) |
320 NotifyWindowManagerAboutSignout(); | 320 NotifyWindowManagerAboutSignout(); |
321 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); | 321 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); |
322 if (cros_library->EnsureLoaded()) { | 322 if (cros_library->libcros_loaded()) { |
satorux1
2011/11/16 23:51:34
I think system::runtime_environment::IsRunningOnCh
stevenjb
2011/11/17 00:23:33
Done.
| |
323 // If update has been installed, reboot, otherwise, sign out. | 323 // If update has been installed, reboot, otherwise, sign out. |
324 if (cros_library->GetUpdateLibrary()->status().status == | 324 if (cros_library->GetUpdateLibrary()->status().status == |
325 chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) { | 325 chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
326 cros_library->GetUpdateLibrary()->RebootAfterUpdate(); | 326 cros_library->GetUpdateLibrary()->RebootAfterUpdate(); |
327 } else { | 327 } else { |
328 chromeos::DBusThreadManager::Get()->GetSessionManagerClient() | 328 chromeos::DBusThreadManager::Get()->GetSessionManagerClient() |
329 ->StopSession(); | 329 ->StopSession(); |
330 } | 330 } |
331 return; | 331 return; |
332 } | 332 } |
333 // If running the Chrome OS build, but we're not on the device, fall through | 333 // If running the Chrome OS build, but we're not on the device, fall through |
satorux1
2011/11/16 23:51:34
per this comment.
stevenjb
2011/11/17 00:23:33
Done.
| |
334 #endif | 334 #endif |
335 AllBrowsersClosedAndAppExiting(); | 335 AllBrowsersClosedAndAppExiting(); |
336 } | 336 } |
337 | 337 |
338 // static | 338 // static |
339 void BrowserList::RemoveBrowser(Browser* browser) { | 339 void BrowserList::RemoveBrowser(Browser* browser) { |
340 RemoveBrowserFrom(browser, &last_active_browsers_); | 340 RemoveBrowserFrom(browser, &last_active_browsers_); |
341 | 341 |
342 // Closing all windows does not indicate quitting the application on the Mac, | 342 // Closing all windows does not indicate quitting the application on the Mac, |
343 // however, many UI tests rely on this behavior so leave it be for now and | 343 // however, many UI tests rely on this behavior so leave it be for now and |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
815 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 815 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
816 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 816 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
817 cur_ = *bg_printing_iterator_; | 817 cur_ = *bg_printing_iterator_; |
818 CHECK(cur_); | 818 CHECK(cur_); |
819 ++bg_printing_iterator_; | 819 ++bg_printing_iterator_; |
820 return; | 820 return; |
821 } | 821 } |
822 // Reached the end - no more TabContents. | 822 // Reached the end - no more TabContents. |
823 cur_ = NULL; | 823 cur_ = NULL; |
824 } | 824 } |
OLD | NEW |