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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 } | 377 } |
378 | 378 |
379 void OnAppExiting() { | 379 void OnAppExiting() { |
380 static bool notified = false; | 380 static bool notified = false; |
381 if (notified) | 381 if (notified) |
382 return; | 382 return; |
383 notified = true; | 383 notified = true; |
384 HandleAppExitingForPlatform(); | 384 HandleAppExitingForPlatform(); |
385 } | 385 } |
386 | 386 |
| 387 bool ShouldStartShutdown(Browser* browser) { |
| 388 if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1) |
| 389 return false; |
| 390 #if defined(OS_WIN) && defined(USE_AURA) |
| 391 // On Windows 8 browser windows could be open in ASH and in the desktop. We |
| 392 // should not start the shutdown process if browser windows are open in the |
| 393 // other environment. |
| 394 chrome::HostDesktopType other_desktop = |
| 395 (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE ? |
| 396 chrome::HOST_DESKTOP_TYPE_ASH : chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 397 if (!BrowserList::GetInstance(other_desktop)->empty()) |
| 398 return false; |
| 399 #endif |
| 400 return true; |
| 401 } |
| 402 |
387 } // namespace chrome | 403 } // namespace chrome |
OLD | NEW |