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

Unified Diff: ash/system/tray_caps_lock.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/tray_caps_lock.h ('k') | ash/system/tray_update.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray_caps_lock.cc
diff --git a/ash/system/tray_caps_lock.cc b/ash/system/tray_caps_lock.cc
index c3f01e181398cee309253e76cfcb0f8ffe1855de..729fc88c0f1b560920d5ec8b07daff2f2f2f200e 100644
--- a/ash/system/tray_caps_lock.cc
+++ b/ash/system/tray_caps_lock.cc
@@ -98,6 +98,8 @@ class CapsLockDefaultView : public ActionableView {
TrayCapsLock::TrayCapsLock()
: TrayImageItem(IDR_AURA_UBER_TRAY_CAPS_LOCK),
+ default_(NULL),
+ detailed_(NULL),
search_mapped_to_caps_lock_(false),
caps_lock_enabled_(
Shell::GetInstance()->tray_delegate()->IsCapsLockOn()) {
@@ -112,13 +114,15 @@ bool TrayCapsLock::GetInitialVisibility() {
views::View* TrayCapsLock::CreateDefaultView(user::LoginStatus status) {
if (!caps_lock_enabled_)
return NULL;
- default_.reset(new CapsLockDefaultView);
+ DCHECK(default_ == NULL);
+ default_ = new CapsLockDefaultView;
default_->Update(caps_lock_enabled_, search_mapped_to_caps_lock_);
- return default_.get();
+ return default_;
}
views::View* TrayCapsLock::CreateDetailedView(user::LoginStatus status) {
- detailed_.reset(new views::View);
+ DCHECK(detailed_ == NULL);
+ detailed_ = new views::View;
detailed_->SetLayoutManager(new
views::BoxLayout(views::BoxLayout::kHorizontal,
@@ -137,15 +141,15 @@ views::View* TrayCapsLock::CreateDetailedView(user::LoginStatus status) {
detailed_->AddChildView(
new views::Label(bundle.GetLocalizedString(string_id)));
- return detailed_.get();
+ return detailed_;
}
void TrayCapsLock::DestroyDefaultView() {
- default_.reset();
+ default_ = NULL;
}
void TrayCapsLock::DestroyDetailedView() {
- detailed_.reset();
+ detailed_ = NULL;
}
void TrayCapsLock::OnCapsLockChanged(bool enabled,
@@ -156,12 +160,12 @@ void TrayCapsLock::OnCapsLockChanged(bool enabled,
caps_lock_enabled_ = enabled;
search_mapped_to_caps_lock_ = search_mapped_to_caps_lock;
- if (default_.get()) {
+ if (default_) {
default_->Update(enabled, search_mapped_to_caps_lock);
} else {
if (enabled)
PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false);
- else if (detailed_.get())
+ else if (detailed_)
detailed_->GetWidget()->Close();
}
}
« no previous file with comments | « ash/system/tray_caps_lock.h ('k') | ash/system/tray_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698