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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 static bool notified = false; | 388 static bool notified = false; |
389 if (notified) | 389 if (notified) |
390 return; | 390 return; |
391 notified = true; | 391 notified = true; |
392 HandleAppExitingForPlatform(); | 392 HandleAppExitingForPlatform(); |
393 } | 393 } |
394 | 394 |
395 bool ShouldStartShutdown(Browser* browser) { | 395 bool ShouldStartShutdown(Browser* browser) { |
396 if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1) | 396 if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1) |
397 return false; | 397 return false; |
398 #if defined(OS_WIN) && defined(USE_AURA) | 398 #if defined(OS_WIN) |
399 // On Windows 8 the desktop and ASH environments could be active | 399 // On Windows 8 the desktop and ASH environments could be active |
400 // at the same time. | 400 // at the same time. |
401 // We should not start the shutdown process in the following cases:- | 401 // We should not start the shutdown process in the following cases:- |
402 // 1. If the desktop type of the browser going away is ASH and there | 402 // 1. If the desktop type of the browser going away is ASH and there |
403 // are browser windows open in the desktop. | 403 // are browser windows open in the desktop. |
404 // 2. If the desktop type of the browser going away is desktop and the ASH | 404 // 2. If the desktop type of the browser going away is desktop and the ASH |
405 // environment is still active. | 405 // environment is still active. |
406 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 406 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
407 return !ash::Shell::HasInstance(); | 407 return !ash::Shell::HasInstance(); |
408 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 408 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
409 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 409 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
410 #endif | 410 #endif |
411 return true; | 411 return true; |
412 } | 412 } |
413 | 413 |
414 } // namespace chrome | 414 } // namespace chrome |
OLD | NEW |