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

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

Issue 10836094: Destroy SystemTrayDelegate in Shutdown() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« 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) 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/status_area_widget.h" 5 #include "ash/system/status_area_widget.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 void StatusAreaWidget::CreateTrayViews(ShellDelegate* shell_delegate) { 299 void StatusAreaWidget::CreateTrayViews(ShellDelegate* shell_delegate) {
300 AddWebNotificationTray(new WebNotificationTray(this)); 300 AddWebNotificationTray(new WebNotificationTray(this));
301 AddSystemTray(new SystemTray(this), shell_delegate); 301 AddSystemTray(new SystemTray(this), shell_delegate);
302 } 302 }
303 303
304 void StatusAreaWidget::Shutdown() { 304 void StatusAreaWidget::Shutdown() {
305 // Destroy the trays early, causing them to be removed from the view 305 // Destroy the trays early, causing them to be removed from the view
306 // hierarchy. Do not used scoped pointers since we don't want to destroy them 306 // hierarchy. Do not used scoped pointers since we don't want to destroy them
307 // in the destructor if Shutdown() is not called (e.g. in tests). 307 // in the destructor if Shutdown() is not called (e.g. in tests).
308 system_tray_delegate_.reset();
308 delete system_tray_; 309 delete system_tray_;
309 system_tray_ = NULL; 310 system_tray_ = NULL;
310 delete web_notification_tray_; 311 delete web_notification_tray_;
311 web_notification_tray_ = NULL; 312 web_notification_tray_ = NULL;
312 } 313 }
313 314
314 void StatusAreaWidget::AddSystemTray(SystemTray* system_tray, 315 void StatusAreaWidget::AddSystemTray(SystemTray* system_tray,
315 ShellDelegate* shell_delegate) { 316 ShellDelegate* shell_delegate) {
316 system_tray_ = system_tray; 317 system_tray_ = system_tray;
317 widget_delegate_->AddTray(system_tray); 318 widget_delegate_->AddTray(system_tray);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 user::LoginStatus login_status) { 370 user::LoginStatus login_status) {
370 login_status_ = login_status; 371 login_status_ = login_status;
371 if (system_tray_) 372 if (system_tray_)
372 system_tray_->UpdateAfterLoginStatusChange(login_status); 373 system_tray_->UpdateAfterLoginStatusChange(login_status);
373 if (web_notification_tray_) 374 if (web_notification_tray_)
374 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); 375 web_notification_tray_->UpdateAfterLoginStatusChange(login_status);
375 } 376 }
376 377
377 } // namespace internal 378 } // namespace internal
378 } // namespace ash 379 } // namespace ash
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