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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell/panel_window.h" | 10 #include "ash/shell/panel_window.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "ash/system/chromeos/enterprise/tray_enterprise.h" | 51 #include "ash/system/chromeos/enterprise/tray_enterprise.h" |
52 #include "ash/system/chromeos/managed/tray_locally_managed_user.h" | 52 #include "ash/system/chromeos/managed/tray_locally_managed_user.h" |
53 #include "ash/system/chromeos/network/tray_network.h" | 53 #include "ash/system/chromeos/network/tray_network.h" |
54 #include "ash/system/chromeos/network/tray_sms.h" | 54 #include "ash/system/chromeos/network/tray_sms.h" |
55 #include "ash/system/chromeos/network/tray_vpn.h" | 55 #include "ash/system/chromeos/network/tray_vpn.h" |
56 #include "ash/system/chromeos/power/tray_power.h" | 56 #include "ash/system/chromeos/power/tray_power.h" |
57 #include "ash/system/chromeos/screen_security/screen_capture_tray_item.h" | 57 #include "ash/system/chromeos/screen_security/screen_capture_tray_item.h" |
58 #include "ash/system/chromeos/screen_security/screen_share_tray_item.h" | 58 #include "ash/system/chromeos/screen_security/screen_share_tray_item.h" |
59 #include "ash/system/chromeos/settings/tray_settings.h" | 59 #include "ash/system/chromeos/settings/tray_settings.h" |
60 #include "ash/system/chromeos/tray_display.h" | 60 #include "ash/system/chromeos/tray_display.h" |
| 61 #include "ui/message_center/message_center.h" |
61 #endif | 62 #endif |
62 | 63 |
63 using views::TrayBubbleView; | 64 using views::TrayBubbleView; |
64 | 65 |
65 namespace ash { | 66 namespace ash { |
66 | 67 |
67 // The minimum width of the system tray menu width. | 68 // The minimum width of the system tray menu width. |
68 const int kMinimumSystemTrayMenuWidth = 300; | 69 const int kMinimumSystemTrayMenuWidth = 300; |
69 | 70 |
70 namespace internal { | 71 namespace internal { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } // namespace internal | 114 } // namespace internal |
114 | 115 |
115 // SystemTray | 116 // SystemTray |
116 | 117 |
117 using internal::SystemTrayBubble; | 118 using internal::SystemTrayBubble; |
118 | 119 |
119 SystemTray::SystemTray(internal::StatusAreaWidget* status_area_widget) | 120 SystemTray::SystemTray(internal::StatusAreaWidget* status_area_widget) |
120 : internal::TrayBackgroundView(status_area_widget), | 121 : internal::TrayBackgroundView(status_area_widget), |
121 items_(), | 122 items_(), |
122 default_bubble_height_(0), | 123 default_bubble_height_(0), |
123 hide_notifications_(false) { | 124 hide_notifications_(false), |
| 125 tray_accessibility_(NULL) { |
124 SetContentsBackground(); | 126 SetContentsBackground(); |
125 } | 127 } |
126 | 128 |
127 SystemTray::~SystemTray() { | 129 SystemTray::~SystemTray() { |
128 // Destroy any child views that might have back pointers before ~View(). | 130 // Destroy any child views that might have back pointers before ~View(). |
129 system_bubble_.reset(); | 131 system_bubble_.reset(); |
130 notification_bubble_.reset(); | 132 notification_bubble_.reset(); |
131 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); | 133 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); |
132 it != items_.end(); | 134 it != items_.end(); |
133 ++it) { | 135 ++it) { |
(...skipping 23 matching lines...) Expand all Loading... |
157 | 159 |
158 #endif | 160 #endif |
159 #if defined(OS_CHROMEOS) | 161 #if defined(OS_CHROMEOS) |
160 AddTrayItem(new internal::TrayEnterprise(this)); | 162 AddTrayItem(new internal::TrayEnterprise(this)); |
161 AddTrayItem(new internal::TrayLocallyManagedUser(this)); | 163 AddTrayItem(new internal::TrayLocallyManagedUser(this)); |
162 #endif | 164 #endif |
163 AddTrayItem(new internal::TrayIME(this)); | 165 AddTrayItem(new internal::TrayIME(this)); |
164 tray_accessibility_ = new internal::TrayAccessibility(this); | 166 tray_accessibility_ = new internal::TrayAccessibility(this); |
165 AddTrayItem(tray_accessibility_); | 167 AddTrayItem(tray_accessibility_); |
166 #if defined(OS_CHROMEOS) | 168 #if defined(OS_CHROMEOS) |
167 AddTrayItem(new internal::TrayPower(this)); | 169 AddTrayItem( |
| 170 new internal::TrayPower(this, message_center::MessageCenter::Get())); |
168 #endif | 171 #endif |
169 #if defined(OS_CHROMEOS) | 172 #if defined(OS_CHROMEOS) |
170 AddTrayItem(new internal::TrayNetwork(this)); | 173 AddTrayItem(new internal::TrayNetwork(this)); |
171 AddTrayItem(new internal::TrayVPN(this)); | 174 AddTrayItem(new internal::TrayVPN(this)); |
172 AddTrayItem(new internal::TraySms(this)); | 175 AddTrayItem(new internal::TraySms(this)); |
173 #endif | 176 #endif |
174 #if !defined(OS_WIN) | 177 #if !defined(OS_WIN) |
175 AddTrayItem(new internal::TrayBluetooth(this)); | 178 AddTrayItem(new internal::TrayBluetooth(this)); |
176 #endif | 179 #endif |
177 AddTrayItem(new internal::TrayDrive(this)); | 180 AddTrayItem(new internal::TrayDrive(this)); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 ConvertPointToWidget(this, &point); | 593 ConvertPointToWidget(this, &point); |
591 arrow_offset = point.x(); | 594 arrow_offset = point.x(); |
592 } | 595 } |
593 } | 596 } |
594 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); | 597 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); |
595 } | 598 } |
596 return true; | 599 return true; |
597 } | 600 } |
598 | 601 |
599 } // namespace ash | 602 } // namespace ash |
OLD | NEW |