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

Unified Diff: ash/shell.cc

Issue 11312139: Add SystemTrayObservers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment. Created 8 years, 1 month 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/shell.h ('k') | ash/system/status_area_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 11fe19f2c244de9b5638d148986f7fd232d1debc..322259741ff4b3e4cdc1edde37762201f5ebd77f 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -28,6 +28,7 @@
#include "ash/shell_window_ids.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/system_tray_delegate.h"
+#include "ash/system/tray/system_tray_notifier.h"
#include "ash/tooltips/tooltip_controller.h"
#include "ash/touch/touch_observer_hud.h"
#include "ash/wm/activation_controller.h"
@@ -255,6 +256,11 @@ Shell::~Shell() {
// Destroy SystemTrayDelegate before destroying the status area(s).
system_tray_delegate_.reset();
+ // Destroy SystemTrayNotifier immediately after destroying SystemTrayDelegate
+ // so that it is still available when shutting down the UI, but not after
+ // the notifier observers have been destroyed.
+ system_tray_notifier_.reset();
+
// Destroy all child windows including widgets.
display_controller_->CloseChildWindows();
@@ -491,6 +497,9 @@ void Shell::Init() {
shadow_controller_.reset(new internal::ShadowController());
}
+ // Create system_tray_notifier_ before the delegate.
+ system_tray_notifier_.reset(new ash::SystemTrayNotifier());
+
// Initialize system_tray_delegate_ before initializing StatusAreaWidget.
system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate());
if (!system_tray_delegate_.get())
« no previous file with comments | « ash/shell.h ('k') | ash/system/status_area_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698