| 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 "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/notifications/notification_ui_manager.h" | 10 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 11 #include "ui/views/widget/widget.h" | 11 #include "ui/views/widget/widget.h" |
| 12 | 12 |
| 13 #if defined(USE_ASH) | 13 #if defined(USE_ASH) |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ui/aura/client/capture_client.h" | 15 #include "ui/aura/client/capture_client.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace browser { | 18 namespace chrome { |
| 19 | 19 |
| 20 void HandleAppExitingForPlatform() { | 20 void HandleAppExitingForPlatform() { |
| 21 // Close all non browser windows now. Those includes notifications | 21 // Close all non browser windows now. Those includes notifications |
| 22 // and windows created by Ash (launcher, background, etc). | 22 // and windows created by Ash (launcher, background, etc). |
| 23 #if defined(USE_ASH) | 23 #if defined(USE_ASH) |
| 24 // This may be called before |ash::Shell| is initialized when | 24 // This may be called before |ash::Shell| is initialized when |
| 25 // XIOError is reported. crbug.com/150633. | 25 // XIOError is reported. crbug.com/150633. |
| 26 if (ash::Shell::HasInstance()) { | 26 if (ash::Shell::HasInstance()) { |
| 27 g_browser_process->notification_ui_manager()->CancelAll(); | 27 g_browser_process->notification_ui_manager()->CancelAll(); |
| 28 // Releasing the capture will close any menus that might be open: | 28 // Releasing the capture will close any menus that might be open: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 44 // Make sure we have notified the session manager that we are exiting. | 44 // Make sure we have notified the session manager that we are exiting. |
| 45 // This might be called from FastShutdown() or CloseAllBrowsers(), but not | 45 // This might be called from FastShutdown() or CloseAllBrowsers(), but not |
| 46 // if something prevents a browser from closing before SetTryingToQuit() | 46 // if something prevents a browser from closing before SetTryingToQuit() |
| 47 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true). | 47 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true). |
| 48 // NotifyAndTerminate does nothing if called more than once. | 48 // NotifyAndTerminate does nothing if called more than once. |
| 49 NotifyAndTerminate(true); | 49 NotifyAndTerminate(true); |
| 50 } | 50 } |
| 51 #endif // OS_CHROMEOS | 51 #endif // OS_CHROMEOS |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace browser | 54 } // namespace chrome |
| OLD | NEW |