OLD | NEW |
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 "chrome/browser/lifetime/application_lifetime.h" | 5 #include "chrome/browser/lifetime/application_lifetime.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1) | 409 if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1) |
410 return false; | 410 return false; |
411 #if defined(OS_WIN) | 411 #if defined(OS_WIN) |
412 // On Windows 8 the desktop and ASH environments could be active | 412 // On Windows 8 the desktop and ASH environments could be active |
413 // at the same time. | 413 // at the same time. |
414 // We should not start the shutdown process in the following cases:- | 414 // We should not start the shutdown process in the following cases:- |
415 // 1. If the desktop type of the browser going away is ASH and there | 415 // 1. If the desktop type of the browser going away is ASH and there |
416 // are browser windows open in the desktop. | 416 // are browser windows open in the desktop. |
417 // 2. If the desktop type of the browser going away is desktop and the ASH | 417 // 2. If the desktop type of the browser going away is desktop and the ASH |
418 // environment is still active. | 418 // environment is still active. |
419 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 419 if (browser->host_desktop_type() == ui::HOST_DESKTOP_TYPE_NATIVE) |
420 return !ash::Shell::HasInstance(); | 420 return !ash::Shell::HasInstance(); |
421 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 421 else if (browser->host_desktop_type() == ui::HOST_DESKTOP_TYPE_ASH) |
422 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 422 return BrowserList::GetInstance(ui::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
423 #endif | 423 #endif |
424 return true; | 424 return true; |
425 } | 425 } |
426 | 426 |
427 void DisableShutdownForTesting(bool disable_shutdown_for_testing) { | 427 void DisableShutdownForTesting(bool disable_shutdown_for_testing) { |
428 g_disable_shutdown_for_testing = disable_shutdown_for_testing; | 428 g_disable_shutdown_for_testing = disable_shutdown_for_testing; |
429 if (!g_disable_shutdown_for_testing && !WillKeepAlive()) | 429 if (!g_disable_shutdown_for_testing && !WillKeepAlive()) |
430 CloseAllBrowsersIfNeeded(); | 430 CloseAllBrowsersIfNeeded(); |
431 } | 431 } |
432 | 432 |
433 } // namespace chrome | 433 } // namespace chrome |
OLD | NEW |