system_tray_item.cc revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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.
4
5#include "ash/system/tray/system_tray_item.h"
6
7#include "ash/shell.h"
8#include "ash/system/tray/system_tray.h"
9#include "ash/system/tray/system_tray_delegate.h"
10#include "ui/views/view.h"
11
12namespace ash {
13
14SystemTrayItem::SystemTrayItem(SystemTray* system_tray)
15    : system_tray_(system_tray) {
16}
17
18SystemTrayItem::~SystemTrayItem() {
19}
20
21views::View* SystemTrayItem::CreateTrayView(user::LoginStatus status) {
22  return NULL;
23}
24
25views::View* SystemTrayItem::CreateDefaultView(user::LoginStatus status) {
26  return NULL;
27}
28
29views::View* SystemTrayItem::CreateDetailedView(user::LoginStatus status) {
30  return NULL;
31}
32
33views::View* SystemTrayItem::CreateNotificationView(user::LoginStatus status) {
34  return NULL;
35}
36
37void SystemTrayItem::DestroyTrayView() {
38}
39
40void SystemTrayItem::DestroyDefaultView() {
41}
42
43void SystemTrayItem::DestroyDetailedView() {
44}
45
46void SystemTrayItem::DestroyNotificationView() {
47}
48
49void SystemTrayItem::TransitionDetailedView() {
50  system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING);
51}
52
53void SystemTrayItem::UpdateAfterLoginStatusChange(user::LoginStatus status) {
54}
55
56void SystemTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
57}
58
59void 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())
62    return;
63  system_tray()->ShowDetailedView(
64      this, for_seconds, activate, BUBBLE_CREATE_NEW);
65}
66
67void SystemTrayItem::SetDetailedViewCloseDelay(int for_seconds) {
68  system_tray()->SetDetailedViewCloseDelay(for_seconds);
69}
70
71void SystemTrayItem::HideDetailedView() {
72  system_tray()->HideDetailedView(this);
73}
74
75void SystemTrayItem::ShowNotificationView() {
76  system_tray()->ShowNotificationView(this);
77}
78
79void SystemTrayItem::HideNotificationView() {
80  system_tray()->HideNotificationView(this);
81}
82
83bool SystemTrayItem::ShouldHideArrow() const {
84  return false;
85}
86
87bool SystemTrayItem::ShouldShowLauncher() const {
88  return true;
89}
90
91}  // namespace ash
92