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

Unified Diff: ash/system/bluetooth/tray_bluetooth.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/bluetooth/tray_bluetooth.cc
diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc
index ac4cd15f069ef677005925ead52dbf1ca65ae22b..2e568ed79f1b9ada01d25759a898e64b0b7decb9 100644
--- a/ash/system/bluetooth/tray_bluetooth.cc
+++ b/ash/system/bluetooth/tray_bluetooth.cc
@@ -31,8 +31,8 @@ namespace tray {
class BluetoothDefaultView : public TrayItemMore {
public:
- explicit BluetoothDefaultView(SystemTrayItem* owner)
- : TrayItemMore(owner, true) {
+ explicit BluetoothDefaultView(SystemTrayItem* tray)
bartfab (slow) 2012/11/16 15:01:35 I renamed |owner| to |tray| here and elsewhere for
stevenjb 2012/11/16 17:41:43 Actually, sorry to push back on this, but "tray" i
bartfab (slow) 2012/11/16 18:45:34 I picked |tray| over |owner| because it seems to h
+ : TrayItemMore(tray, true) {
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_BLUETOOTH).ToImageSkia());
UpdateLabel();
@@ -62,8 +62,9 @@ class BluetoothDetailedView : public TrayDetailsView,
public ViewClickListener,
public views::ButtonListener {
public:
- explicit BluetoothDetailedView(user::LoginStatus login)
- : login_(login),
+ BluetoothDetailedView(SystemTrayItem* tray, user::LoginStatus login)
+ : TrayDetailsView(tray),
+ login_(login),
add_device_(NULL),
toggle_bluetooth_(NULL) {
BluetoothDeviceList list;
@@ -175,7 +176,7 @@ class BluetoothDetailedView : public TrayDetailsView,
ash::SystemTrayDelegate* delegate =
ash::Shell::GetInstance()->tray_delegate();
if (sender == footer()->content()) {
- Shell::GetInstance()->system_tray()->ShowDefaultView(BUBBLE_USE_EXISTING);
+ tray()->system_tray()->ShowDefaultView(BUBBLE_USE_EXISTING);
} else if (sender == add_device_) {
if (!delegate->GetBluetoothEnabled())
delegate->ToggleBluetooth();
@@ -213,8 +214,9 @@ class BluetoothDetailedView : public TrayDetailsView,
} // namespace tray
-TrayBluetooth::TrayBluetooth()
- : default_(NULL),
+TrayBluetooth::TrayBluetooth(SystemTray* system_tray)
+ : SystemTrayItem(system_tray),
+ default_(NULL),
detailed_(NULL) {
}
@@ -235,7 +237,7 @@ views::View* TrayBluetooth::CreateDetailedView(user::LoginStatus status) {
if (!Shell::GetInstance()->tray_delegate()->GetBluetoothAvailable())
return NULL;
CHECK(detailed_ == NULL);
- detailed_ = new tray::BluetoothDetailedView(status);
+ detailed_ = new tray::BluetoothDetailedView(this, status);
return detailed_;
}

Powered by Google App Engine
This is Rietveld 408576698