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/browser/app_mode/app_mode_utils.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 "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/switch_utils.h" |
11 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
12 | 14 |
13 #if defined(USE_ASH) | 15 #if defined(USE_ASH) |
14 #include "ash/shell.h" | 16 #include "ash/shell.h" |
15 #include "ui/aura/client/capture_client.h" | 17 #include "ui/aura/client/capture_client.h" |
16 #endif | 18 #endif |
17 | 19 |
18 namespace chrome { | 20 namespace chrome { |
19 | 21 |
20 void HandleAppExitingForPlatform() { | 22 void HandleAppExitingForPlatform() { |
(...skipping 10 matching lines...) Expand all Loading... |
31 SetCapture(NULL); | 33 SetCapture(NULL); |
32 } | 34 } |
33 #else | 35 #else |
34 g_browser_process->notification_ui_manager()->CancelAll(); | 36 g_browser_process->notification_ui_manager()->CancelAll(); |
35 #endif | 37 #endif |
36 | 38 |
37 views::Widget::CloseAllSecondaryWidgets(); | 39 views::Widget::CloseAllSecondaryWidgets(); |
38 | 40 |
39 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
40 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 42 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
41 switches::kDisableZeroBrowsersOpenForTests)) { | 43 switches::kDisableZeroBrowsersOpenForTests) && |
| 44 !chrome::IsRunningInAppMode()) { |
42 // App is exiting, call EndKeepAlive() on behalf of Aura Shell. | 45 // App is exiting, call EndKeepAlive() on behalf of Aura Shell. |
43 EndKeepAlive(); | 46 EndKeepAlive(); |
44 // Make sure we have notified the session manager that we are exiting. | 47 // Make sure we have notified the session manager that we are exiting. |
45 // This might be called from FastShutdown() or CloseAllBrowsers(), but not | 48 // This might be called from FastShutdown() or CloseAllBrowsers(), but not |
46 // if something prevents a browser from closing before SetTryingToQuit() | 49 // if something prevents a browser from closing before SetTryingToQuit() |
47 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true). | 50 // gets called (e.g. browser->TabsNeedBeforeUnloadFired() is true). |
48 // NotifyAndTerminate does nothing if called more than once. | 51 // NotifyAndTerminate does nothing if called more than once. |
49 NotifyAndTerminate(true); | 52 NotifyAndTerminate(true); |
50 } | 53 } |
51 #endif // OS_CHROMEOS | 54 #endif // OS_CHROMEOS |
52 } | 55 } |
53 | 56 |
54 } // namespace chrome | 57 } // namespace chrome |
OLD | NEW |