summaryrefslogtreecommitdiffstats
path: root/ash/shell.cc
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 01:11:00 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 01:11:00 +0000
commit83b2b84c1e4bc8434630f58e88bcf1a93b33ded6 (patch)
treee6612ff5286a73ed99df758ee600f331396e51d6 /ash/shell.cc
parentd8f1004bcf08a2c0d629198a3695808b3a400487 (diff)
downloadchromium_src-83b2b84c1e4bc8434630f58e88bcf1a93b33ded6.zip
chromium_src-83b2b84c1e4bc8434630f58e88bcf1a93b33ded6.tar.gz
chromium_src-83b2b84c1e4bc8434630f58e88bcf1a93b33ded6.tar.bz2
Add SystemTrayObservers
Once there is more than one SystemTray instance, we will need to support observer lists so that multiple tray items can be notified. Hosting the observer lists in a separate class owned by ass::SystemTrayDelegate seemed like the most forward approach. BUG=159543 For ash.gyp: TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11312139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell.cc')
-rw-r--r--ash/shell.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/ash/shell.cc b/ash/shell.cc
index bac0bb6..45dc886 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -29,6 +29,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"
@@ -257,6 +258,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();
@@ -495,6 +501,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())