• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
12 namespace ash {
13 
SystemTrayItem(SystemTray * system_tray)14 SystemTrayItem::SystemTrayItem(SystemTray* system_tray)
15     : system_tray_(system_tray),
16       restore_focus_(false) {
17 }
18 
~SystemTrayItem()19 SystemTrayItem::~SystemTrayItem() {
20 }
21 
CreateTrayView(user::LoginStatus status)22 views::View* SystemTrayItem::CreateTrayView(user::LoginStatus status) {
23   return NULL;
24 }
25 
CreateDefaultView(user::LoginStatus status)26 views::View* SystemTrayItem::CreateDefaultView(user::LoginStatus status) {
27   return NULL;
28 }
29 
CreateDetailedView(user::LoginStatus status)30 views::View* SystemTrayItem::CreateDetailedView(user::LoginStatus status) {
31   return NULL;
32 }
33 
CreateNotificationView(user::LoginStatus status)34 views::View* SystemTrayItem::CreateNotificationView(user::LoginStatus status) {
35   return NULL;
36 }
37 
DestroyTrayView()38 void SystemTrayItem::DestroyTrayView() {
39 }
40 
DestroyDefaultView()41 void SystemTrayItem::DestroyDefaultView() {
42 }
43 
DestroyDetailedView()44 void SystemTrayItem::DestroyDetailedView() {
45 }
46 
DestroyNotificationView()47 void SystemTrayItem::DestroyNotificationView() {
48 }
49 
TransitionDetailedView()50 void SystemTrayItem::TransitionDetailedView() {
51   system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING);
52 }
53 
UpdateAfterLoginStatusChange(user::LoginStatus status)54 void SystemTrayItem::UpdateAfterLoginStatusChange(user::LoginStatus status) {
55 }
56 
UpdateAfterShelfAlignmentChange(ShelfAlignment alignment)57 void SystemTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
58 }
59 
PopupDetailedView(int for_seconds,bool activate)60 void SystemTrayItem::PopupDetailedView(int for_seconds, bool activate) {
61   // Never show a detailed view during OOBE, e.g. from a notification.
62   if (!Shell::GetInstance()->system_tray_delegate()->IsOobeCompleted())
63     return;
64   system_tray()->ShowDetailedView(
65       this, for_seconds, activate, BUBBLE_CREATE_NEW);
66 }
67 
SetDetailedViewCloseDelay(int for_seconds)68 void SystemTrayItem::SetDetailedViewCloseDelay(int for_seconds) {
69   system_tray()->SetDetailedViewCloseDelay(for_seconds);
70 }
71 
HideDetailedView()72 void SystemTrayItem::HideDetailedView() {
73   system_tray()->HideDetailedView(this);
74 }
75 
ShowNotificationView()76 void SystemTrayItem::ShowNotificationView() {
77   system_tray()->ShowNotificationView(this);
78 }
79 
HideNotificationView()80 void SystemTrayItem::HideNotificationView() {
81   system_tray()->HideNotificationView(this);
82 }
83 
ShouldHideArrow() const84 bool SystemTrayItem::ShouldHideArrow() const {
85   return false;
86 }
87 
ShouldShowLauncher() const88 bool SystemTrayItem::ShouldShowLauncher() const {
89   return true;
90 }
91 
92 }  // namespace ash
93