| 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 "chrome/browser/chromeos/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
| 10 #include "ash/system/bluetooth/bluetooth_observer.h" | 10 #include "ash/system/bluetooth/bluetooth_observer.h" |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 virtual void OnCellularDataPlanChanged(NetworkLibrary* crosnet) OVERRIDE { | 1005 virtual void OnCellularDataPlanChanged(NetworkLibrary* crosnet) OVERRIDE { |
| 1006 NotifyRefreshNetwork(); | 1006 NotifyRefreshNetwork(); |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 // content::NotificationObserver implementation. | 1009 // content::NotificationObserver implementation. |
| 1010 virtual void Observe(int type, | 1010 virtual void Observe(int type, |
| 1011 const content::NotificationSource& source, | 1011 const content::NotificationSource& source, |
| 1012 const content::NotificationDetails& details) OVERRIDE { | 1012 const content::NotificationDetails& details) OVERRIDE { |
| 1013 switch (type) { | 1013 switch (type) { |
| 1014 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { | 1014 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { |
| 1015 UpgradeDetector* detector = |
| 1016 content::Source<UpgradeDetector>(source).ptr(); |
| 1017 ash::UpdateObserver::UpdateSeverity severity = |
| 1018 ash::UpdateObserver::UPDATE_NORMAL; |
| 1019 switch (detector->upgrade_notification_stage()) { |
| 1020 case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE: |
| 1021 severity = ash::UpdateObserver::UPDATE_SEVERE_RED; |
| 1022 break; |
| 1023 |
| 1024 case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH: |
| 1025 severity = ash::UpdateObserver::UPDATE_HIGH_ORANGE; |
| 1026 break; |
| 1027 |
| 1028 case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED: |
| 1029 severity = ash::UpdateObserver::UPDATE_LOW_GREEN; |
| 1030 break; |
| 1031 |
| 1032 case UpgradeDetector::UPGRADE_ANNOYANCE_LOW: |
| 1033 default: |
| 1034 severity = ash::UpdateObserver::UPDATE_NORMAL; |
| 1035 break; |
| 1036 } |
| 1015 ash::UpdateObserver* observer = tray_->update_observer(); | 1037 ash::UpdateObserver* observer = tray_->update_observer(); |
| 1016 if (observer) | 1038 if (observer) |
| 1017 observer->OnUpdateRecommended(); | 1039 observer->OnUpdateRecommended(severity); |
| 1018 break; | 1040 break; |
| 1019 } | 1041 } |
| 1020 case chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED: { | 1042 case chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED: { |
| 1021 // This notification is also sent on login screen when user avatar | 1043 // This notification is also sent on login screen when user avatar |
| 1022 // is loaded from file. | 1044 // is loaded from file. |
| 1023 if (GetUserLoginStatus() != ash::user::LOGGED_IN_NONE) { | 1045 if (GetUserLoginStatus() != ash::user::LOGGED_IN_NONE) { |
| 1024 ash::UserObserver* observer = tray_->user_observer(); | 1046 ash::UserObserver* observer = tray_->user_observer(); |
| 1025 if (observer) | 1047 if (observer) |
| 1026 observer->OnUserUpdate(); | 1048 observer->OnUserUpdate(); |
| 1027 } | 1049 } |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1264 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1243 }; | 1265 }; |
| 1244 | 1266 |
| 1245 } // namespace | 1267 } // namespace |
| 1246 | 1268 |
| 1247 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 1269 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
| 1248 return new chromeos::SystemTrayDelegate(tray); | 1270 return new chromeos::SystemTrayDelegate(tray); |
| 1249 } | 1271 } |
| 1250 | 1272 |
| 1251 } // namespace chromeos | 1273 } // namespace chromeos |
| OLD | NEW |