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

Side by Side Diff: ash/system/tray_update.cc

Issue 10235010: Prepare SystemTray to support notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/tray_update.h" 5 #include "ash/system/tray_update.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/system/tray/tray_constants.h" 9 #include "ash/system/tray/tray_constants.h"
10 #include "ash/system/tray/tray_views.h" 10 #include "ash/system/tray/tray_views.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 DISALLOW_COPY_AND_ASSIGN(UpdateView); 51 DISALLOW_COPY_AND_ASSIGN(UpdateView);
52 }; 52 };
53 53
54 } 54 }
55 55
56 namespace ash { 56 namespace ash {
57 namespace internal { 57 namespace internal {
58 58
59 TrayUpdate::TrayUpdate() 59 TrayUpdate::TrayUpdate()
60 : TrayImageItem(IDR_AURA_UBER_TRAY_UPDATE) { 60 : TrayImageItem(IDR_AURA_UBER_TRAY_UPDATE),
61 default_(NULL) {
61 } 62 }
62 63
63 TrayUpdate::~TrayUpdate() {} 64 TrayUpdate::~TrayUpdate() {}
64 65
65 bool TrayUpdate::GetInitialVisibility() { 66 bool TrayUpdate::GetInitialVisibility() {
66 return Shell::GetInstance()->tray_delegate()->SystemShouldUpgrade(); 67 return Shell::GetInstance()->tray_delegate()->SystemShouldUpgrade();
67 } 68 }
68 69
69 views::View* TrayUpdate::CreateDefaultView(user::LoginStatus status) { 70 views::View* TrayUpdate::CreateDefaultView(user::LoginStatus status) {
70 if (!Shell::GetInstance()->tray_delegate()->SystemShouldUpgrade()) 71 if (!Shell::GetInstance()->tray_delegate()->SystemShouldUpgrade())
71 return NULL; 72 return NULL;
72 default_.reset(new UpdateView); 73 DCHECK(default_ == NULL);
73 return default_.get(); 74 default_ = new UpdateView;
75 return default_;
74 } 76 }
75 77
76 void TrayUpdate::DestroyDefaultView() { 78 void TrayUpdate::DestroyDefaultView() {
77 default_.reset(); 79 default_ = NULL;
78 } 80 }
79 81
80 void TrayUpdate::OnUpdateRecommended() { 82 void TrayUpdate::OnUpdateRecommended() {
81 tray_view()->SetVisible(true); 83 tray_view()->SetVisible(true);
82 } 84 }
83 85
84 } // namespace internal 86 } // namespace internal
85 } // namespace ash 87 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698