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

Unified Diff: ash/system/date/tray_date.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/date/tray_date.cc
diff --git a/ash/system/date/tray_date.cc b/ash/system/date/tray_date.cc
index 46033d07d1fd4707206d6350ffb8dd578b5fb08e..c64f97e146e6d0ebe8f8213440f752fbf810b999 100644
--- a/ash/system/date/tray_date.cc
+++ b/ash/system/date/tray_date.cc
@@ -124,8 +124,9 @@ class DateDefaultView : public views::View,
namespace ash {
namespace internal {
-TrayDate::TrayDate()
- : time_tray_(NULL) {
+TrayDate::TrayDate(SystemTray* system_tray)
+ : SystemTrayItem(system_tray),
+ time_tray_(NULL) {
}
TrayDate::~TrayDate() {
@@ -134,11 +135,10 @@ TrayDate::~TrayDate() {
views::View* TrayDate::CreateTrayView(user::LoginStatus status) {
CHECK(time_tray_ == NULL);
ClockLayout clock_layout =
- ash::Shell::GetInstance()->system_tray()->shelf_alignment() ==
- SHELF_ALIGNMENT_BOTTOM ?
- HORIZONTAL_CLOCK : VERTICAL_CLOCK;
+ system_tray()->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM ?
+ HORIZONTAL_CLOCK : VERTICAL_CLOCK;
time_tray_ = new tray::TimeView(clock_layout);
- views::View* view = new TrayItemView;
+ views::View* view = new TrayItemView(this);
view->AddChildView(time_tray_);
return view;
}

Powered by Google App Engine
This is Rietveld 408576698