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

Side by Side Diff: ash/system/tray/system_tray.cc

Issue 10200006: ash: Refresh the tray items, instead of recreating them, when login status changes. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/system/settings/tray_settings.cc ('k') | ash/system/tray/system_tray_item.h » ('j') | 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/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell/panel_window.h" 8 #include "ash/shell/panel_window.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/system/tray/tray_constants.h" 10 #include "ash/system/tray/tray_constants.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 bubble_->StartAutoCloseTimer(close_delay); 491 bubble_->StartAutoCloseTimer(close_delay);
492 } 492 }
493 493
494 void SystemTray::UpdateAfterLoginStatusChange(user::LoginStatus login_status) { 494 void SystemTray::UpdateAfterLoginStatusChange(user::LoginStatus login_status) {
495 if (popup_) 495 if (popup_)
496 popup_->CloseNow(); 496 popup_->CloseNow();
497 497
498 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); 498 for (std::vector<SystemTrayItem*>::iterator it = items_.begin();
499 it != items_.end(); 499 it != items_.end();
500 ++it) { 500 ++it) {
501 (*it)->DestroyTrayView(); 501 (*it)->UpdateAfterLoginStatusChange(login_status);
502 } 502 }
503 container_->RemoveAllChildViews(true);
504 503
505 for (std::vector<SystemTrayItem*>::iterator it = items_.begin();
506 it != items_.end();
507 ++it) {
508 views::View* view = (*it)->CreateTrayView(login_status);
509 if (view)
510 container_->AddChildViewAt(view, 0);
511 }
512 SetVisible(true); 504 SetVisible(true);
513 PreferredSizeChanged(); 505 PreferredSizeChanged();
514 } 506 }
515 507
516 void SystemTray::SetPaintsBackground( 508 void SystemTray::SetPaintsBackground(
517 bool value, 509 bool value,
518 internal::BackgroundAnimator::ChangeType change_type) { 510 internal::BackgroundAnimator::ChangeType change_type) {
519 hide_background_animator_.SetPaintsBackground(value, change_type); 511 hide_background_animator_.SetPaintsBackground(value, change_type);
520 } 512 }
521 513
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 popup_->Hide(); 623 popup_->Hide();
632 } 624 }
633 } 625 }
634 return base::EVENT_CONTINUE; 626 return base::EVENT_CONTINUE;
635 } 627 }
636 628
637 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { 629 void SystemTray::DidProcessEvent(const base::NativeEvent& event) {
638 } 630 }
639 631
640 } // namespace ash 632 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/settings/tray_settings.cc ('k') | ash/system/tray/system_tray_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698