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