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

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

Issue 10269017: Remove scoped_ptr for system tray views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
« 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 25203244a1504fe4b82bba9a2f8673413f8c5f34..cd0a9d9ff1b10650efa09d459cdbc942bf83fd45 100644
--- a/ash/system/bluetooth/tray_bluetooth.cc
+++ b/ash/system/bluetooth/tray_bluetooth.cc
@@ -220,7 +220,9 @@ class BluetoothDetailedView : public views::View,
} // namespace tray
-TrayBluetooth::TrayBluetooth() {
+TrayBluetooth::TrayBluetooth()
+ : default_(NULL),
+ detailed_(NULL) {
}
TrayBluetooth::~TrayBluetooth() {
@@ -231,26 +233,28 @@ views::View* TrayBluetooth::CreateTrayView(user::LoginStatus status) {
}
views::View* TrayBluetooth::CreateDefaultView(user::LoginStatus status) {
- default_.reset(new tray::BluetoothDefaultView(this));
- return default_.get();
+ CHECK(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();
+ CHECK(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) {
@@ -259,9 +263,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();
- else if (detailed_.get())
+ else if (detailed_)
detailed_->Update(list);
}
« 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