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

Unified Diff: ash/system/bluetooth/tray_bluetooth.cc

Issue 10235010: Prepare SystemTray to support notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 months 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698