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

Unified Diff: ash/system/monitor/tray_monitor.cc

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified CL to provide TrayItems and Tray*Views with parent pointers instead. 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
Index: ash/system/monitor/tray_monitor.cc
diff --git a/ash/system/monitor/tray_monitor.cc b/ash/system/monitor/tray_monitor.cc
index 4e4336d61591dcc825ad61080d6bd3ce44aa7fac..552ba8ffda3e76402f10170107c1020473ad5f32 100644
--- a/ash/system/monitor/tray_monitor.cc
+++ b/ash/system/monitor/tray_monitor.cc
@@ -4,6 +4,7 @@
#include "ash/system/monitor/tray_monitor.h"
+#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/tray_item_view.h"
#include "ash/system/tray/tray_views.h"
#include "base/process_util.h"
@@ -20,7 +21,9 @@ const int kRefreshTimeoutMs = 1000;
namespace ash {
namespace internal {
-TrayMonitor::TrayMonitor() : label_(NULL) {
+TrayMonitor::TrayMonitor(SystemTray* system_tray)
+ : SystemTrayItem(system_tray),
+ label_(NULL) {
refresh_timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kRefreshTimeoutMs),
this, &TrayMonitor::RefreshStats);
@@ -31,7 +34,7 @@ TrayMonitor::~TrayMonitor() {
}
views::View* TrayMonitor::CreateTrayView(user::LoginStatus status) {
- TrayItemView* view = new TrayItemView;
+ TrayItemView* view = new TrayItemView(this);
view->CreateLabel();
label_ = view->label();
SetupLabelForTray(label_);

Powered by Google App Engine
This is Rietveld 408576698