| OLD | NEW |
| 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 } | 500 } |
| 501 container_->RemoveAllChildViews(true); | 501 container_->RemoveAllChildViews(true); |
| 502 | 502 |
| 503 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); | 503 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); |
| 504 it != items_.end(); | 504 it != items_.end(); |
| 505 ++it) { | 505 ++it) { |
| 506 views::View* view = (*it)->CreateTrayView(login_status); | 506 views::View* view = (*it)->CreateTrayView(login_status); |
| 507 if (view) | 507 if (view) |
| 508 container_->AddChildViewAt(new TrayItemContainer(view), 0); | 508 container_->AddChildViewAt(new TrayItemContainer(view), 0); |
| 509 } | 509 } |
| 510 SetVisible(true); |
| 510 PreferredSizeChanged(); | 511 PreferredSizeChanged(); |
| 511 } | 512 } |
| 512 | 513 |
| 513 void SystemTray::SetPaintsBackground( | 514 void SystemTray::SetPaintsBackground( |
| 514 bool value, | 515 bool value, |
| 515 internal::BackgroundAnimator::ChangeType change_type) { | 516 internal::BackgroundAnimator::ChangeType change_type) { |
| 516 background_animator_.SetPaintsBackground(value, change_type); | 517 background_animator_.SetPaintsBackground(value, change_type); |
| 517 } | 518 } |
| 518 | 519 |
| 519 void SystemTray::ShowItems(std::vector<SystemTrayItem*>& items, | 520 void SystemTray::ShowItems(std::vector<SystemTrayItem*>& items, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 } | 593 } |
| 593 | 594 |
| 594 void SystemTray::UpdateBackground(int alpha) { | 595 void SystemTray::UpdateBackground(int alpha) { |
| 595 if (mouse_in_tray_) | 596 if (mouse_in_tray_) |
| 596 alpha += kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha; | 597 alpha += kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha; |
| 597 background_->set_alpha(alpha); | 598 background_->set_alpha(alpha); |
| 598 SchedulePaint(); | 599 SchedulePaint(); |
| 599 } | 600 } |
| 600 | 601 |
| 601 } // namespace ash | 602 } // namespace ash |
| OLD | NEW |