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

Side by Side Diff: chrome/browser/chromeos/notifications/balloon_collection_impl.cc

Issue 5511002: Notification UI should not be reset at browser-close, as the notification ui ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/notifications/balloon_collection_impl.h" 5 #include "chrome/browser/chromeos/notifications/balloon_collection_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/browser_list.h" 10 #include "chrome/browser/browser_list.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // There may be no listener in a unit test. 131 // There may be no listener in a unit test.
132 if (space_change_listener_) 132 if (space_change_listener_)
133 space_change_listener_->OnBalloonSpaceChanged(); 133 space_change_listener_->OnBalloonSpaceChanged();
134 } 134 }
135 135
136 void BalloonCollectionImpl::Observe(NotificationType type, 136 void BalloonCollectionImpl::Observe(NotificationType type,
137 const NotificationSource& source, 137 const NotificationSource& source,
138 const NotificationDetails& details) { 138 const NotificationDetails& details) {
139 DCHECK(type == NotificationType::BROWSER_CLOSED); 139 DCHECK(type == NotificationType::BROWSER_CLOSED);
140 bool app_closing = *Details<bool>(details).ptr(); 140 bool app_closing = *Details<bool>(details).ptr();
141 // When exitting, we need to shutdown all renderers in 141 // When exiting, we need to shutdown all renderers in
142 // BalloonViewImpl before IO thread gets deleted in the 142 // BalloonViewImpl before IO thread gets deleted in the
143 // BrowserProcessImpl's destructor. See http://crbug.com/40810 143 // BrowserProcessImpl's destructor. See http://crbug.com/40810
144 // for details. 144 // for details.
145 if (app_closing) 145 if (app_closing)
146 Shutdown(); 146 RemoveAll();
147 } 147 }
148 148
149 void BalloonCollectionImpl::Shutdown() { 149 void BalloonCollectionImpl::Shutdown() {
150 // We need to remove the panel first because deleting 150 // We need to remove the panel first because deleting
151 // views that are not owned by parent will not remove 151 // views that are not owned by parent will not remove
152 // themselves from the parent. 152 // themselves from the parent.
153 DVLOG(1) << "Shutting down notification UI"; 153 DVLOG(1) << "Shutting down notification UI";
154 notification_ui_.reset(); 154 notification_ui_.reset();
155 } 155 }
156 156
157 Balloon* BalloonCollectionImpl::MakeBalloon(const Notification& notification, 157 Balloon* BalloonCollectionImpl::MakeBalloon(const Notification& notification,
158 Profile* profile) { 158 Profile* profile) {
159 Balloon* new_balloon = new Balloon(notification, profile, this); 159 Balloon* new_balloon = new Balloon(notification, profile, this);
160 new_balloon->set_view(new chromeos::BalloonViewImpl(false, true, false)); 160 new_balloon->set_view(new chromeos::BalloonViewImpl(false, true, false));
161 return new_balloon; 161 return new_balloon;
162 } 162 }
163 163
164 } // namespace chromeos 164 } // namespace chromeos
165 165
166 // static 166 // static
167 BalloonCollection* BalloonCollection::Create() { 167 BalloonCollection* BalloonCollection::Create() {
168 return new chromeos::BalloonCollectionImpl(); 168 return new chromeos::BalloonCollectionImpl();
169 } 169 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698