Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5330)

Unified Diff: chrome/browser/lifetime/application_lifetime_aura.cc

Issue 10952028: Fix crashers in GetPrimaryDisplay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: return display by value Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/screen_ash.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/lifetime/application_lifetime_aura.cc
diff --git a/chrome/browser/lifetime/application_lifetime_aura.cc b/chrome/browser/lifetime/application_lifetime_aura.cc
index dae1f3eeff01ffe41cf320e10f19f18df47d73ff..9547e87b85d23e6e96b87eb6e58167bae8f1c9ad 100644
--- a/chrome/browser/lifetime/application_lifetime_aura.cc
+++ b/chrome/browser/lifetime/application_lifetime_aura.cc
@@ -19,13 +19,18 @@ namespace browser {
void HandleAppExitingForPlatform() {
// Close all non browser windows now. Those includes notifications
// and windows created by Ash (launcher, background, etc).
- g_browser_process->notification_ui_manager()->CancelAll();
-
#if defined(USE_ASH)
- // Releasing the capture will close any menus that might be open:
- // http://crbug.com/134472
- aura::client::GetCaptureClient(ash::Shell::GetPrimaryRootWindow())->
- SetCapture(NULL);
+ // This may be called before |ash::Shell| is initialized when
+ // XIOError is reported. crbug.com/150633.
+ if (ash::Shell::HasInstance()) {
+ g_browser_process->notification_ui_manager()->CancelAll();
+ // Releasing the capture will close any menus that might be open:
+ // http://crbug.com/134472
+ aura::client::GetCaptureClient(ash::Shell::GetPrimaryRootWindow())->
+ SetCapture(NULL);
+ }
+#else
+ g_browser_process->notification_ui_manager()->CancelAll();
#endif
// TODO(oshima): Close all non browser windows here while
« no previous file with comments | « ash/screen_ash.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698