Index: ash/system/bluetooth/tray_bluetooth.cc |
diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc |
index 8352457a3bcd2a8ed79ebc5eca763a33eb3354e1..d6efdc07beec6c5b79572c6dae11358119b4c965 100644 |
--- a/ash/system/bluetooth/tray_bluetooth.cc |
+++ b/ash/system/bluetooth/tray_bluetooth.cc |
@@ -215,7 +215,9 @@ class BluetoothDetailedView : public views::View, |
} // namespace tray |
-TrayBluetooth::TrayBluetooth() { |
+TrayBluetooth::TrayBluetooth() |
+ : default_(NULL), |
+ detailed_(NULL) { |
} |
TrayBluetooth::~TrayBluetooth() { |
@@ -228,26 +230,28 @@ views::View* TrayBluetooth::CreateTrayView(user::LoginStatus status) { |
views::View* TrayBluetooth::CreateDefaultView(user::LoginStatus status) { |
if (!Shell::GetInstance()->tray_delegate()->GetBluetoothAvailable()) |
return NULL; |
- default_.reset(new tray::BluetoothDefaultView(this)); |
- return default_.get(); |
+ DCHECK(default_ == NULL); |
+ default_ = new tray::BluetoothDefaultView(this); |
+ return default_; |
} |
views::View* TrayBluetooth::CreateDetailedView(user::LoginStatus status) { |
if (!Shell::GetInstance()->tray_delegate()->GetBluetoothAvailable()) |
return NULL; |
- detailed_.reset(new tray::BluetoothDetailedView(status)); |
- return detailed_.get(); |
+ DCHECK(detailed_ == NULL); |
+ detailed_ = new tray::BluetoothDetailedView(status); |
+ return detailed_; |
} |
void TrayBluetooth::DestroyTrayView() { |
} |
void TrayBluetooth::DestroyDefaultView() { |
- default_.reset(); |
+ default_ = NULL; |
} |
void TrayBluetooth::DestroyDetailedView() { |
- detailed_.reset(); |
+ detailed_ = NULL; |
} |
void TrayBluetooth::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
@@ -256,9 +260,9 @@ void TrayBluetooth::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
void TrayBluetooth::OnBluetoothRefresh() { |
BluetoothDeviceList list; |
Shell::GetInstance()->tray_delegate()->GetAvailableBluetoothDevices(&list); |
- if (default_.get()) |
+ if (default_) |
default_->UpdateLabel(); |
- if (detailed_.get()) |
+ if (detailed_) |
detailed_->Update(list); |
} |