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

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: Fix single-letter typo :(. 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/system/bluetooth/tray_bluetooth.h ('k') | ash/system/brightness/tray_brightness.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b18da0813aa7634a1a1f40f293efaefea3a059e8 100644
--- a/ash/system/bluetooth/tray_bluetooth.cc
+++ b/ash/system/bluetooth/tray_bluetooth.cc
@@ -62,8 +62,9 @@ class BluetoothDetailedView : public TrayDetailsView,
public ViewClickListener,
public views::ButtonListener {
public:
- explicit BluetoothDetailedView(user::LoginStatus login)
- : login_(login),
+ BluetoothDetailedView(SystemTrayItem* owner, user::LoginStatus login)
+ : TrayDetailsView(owner),
+ 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);
+ owner()->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_;
}
« no previous file with comments | « ash/system/bluetooth/tray_bluetooth.h ('k') | ash/system/brightness/tray_brightness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698