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
3 // found in the LICENSE file.
5 #include "ash/system/tray/system_tray_item.h"
8 #include "ash/system/tray/system_tray.h"
9 #include "ash/system/tray/system_tray_delegate.h"
10 #include "ui/views/view.h"
14 SystemTrayItem::SystemTrayItem(SystemTray
* system_tray
)
15 : system_tray_(system_tray
) {
18 SystemTrayItem::~SystemTrayItem() {
21 views::View
* SystemTrayItem::CreateTrayView(user::LoginStatus status
) {
25 views::View
* SystemTrayItem::CreateDefaultView(user::LoginStatus status
) {
29 views::View
* SystemTrayItem::CreateDetailedView(user::LoginStatus status
) {
33 views::View
* SystemTrayItem::CreateNotificationView(user::LoginStatus status
) {
37 void SystemTrayItem::DestroyTrayView() {
40 void SystemTrayItem::DestroyDefaultView() {
43 void SystemTrayItem::DestroyDetailedView() {
46 void SystemTrayItem::DestroyNotificationView() {
49 void SystemTrayItem::TransitionDetailedView() {
50 system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING
);
53 void SystemTrayItem::UpdateAfterLoginStatusChange(user::LoginStatus status
) {
56 void SystemTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment
) {
59 void SystemTrayItem::PopupDetailedView(int for_seconds
, bool activate
) {
60 // Never show a detailed view during OOBE, e.g. from a notification.
61 if (!Shell::GetInstance()->system_tray_delegate()->IsOobeCompleted())
63 system_tray()->ShowDetailedView(
64 this, for_seconds
, activate
, BUBBLE_CREATE_NEW
);
67 void SystemTrayItem::SetDetailedViewCloseDelay(int for_seconds
) {
68 system_tray()->SetDetailedViewCloseDelay(for_seconds
);
71 void SystemTrayItem::HideDetailedView() {
72 system_tray()->HideDetailedView(this);
75 void SystemTrayItem::ShowNotificationView() {
76 system_tray()->ShowNotificationView(this);
79 void SystemTrayItem::HideNotificationView() {
80 system_tray()->HideNotificationView(this);
83 bool SystemTrayItem::ShouldHideArrow() const {
87 bool SystemTrayItem::ShouldShowLauncher() const {